Fix deploy playground to only run when repository is main Rome one and not a fork
MODIFY
.github/workflows/deploy_playground.yml
.github/workflows/deploy_playground.yml
@@ -41,6 +41,7 @@ jobs:
- name: Publish
uses: jakejarvis/s3-sync-action@master
+ if: github.repository_owner == 'rome'
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
@@ -56,12 +57,12 @@ jobs:
echo "::set-output name=url::$url"
- name: Get the PR number
- if: github.event_name == 'pull_request'
+ if: github.event_name == 'pull_request' && github.repository_owner == 'rome'
id: pr-number
uses: kkak10/pr-number-action@v1.3
- name: Find Previous Comment
- if: github.event_name == 'pull_request'
+ if: github.event_name == 'pull_request' && github.repository_owner == 'rome'
uses: peter-evans/find-comment@v1.3.0
id: previous-comment
with:
@@ -69,7 +70,7 @@ jobs:
body-includes: Playground for commit
- name: Update existing comment
- if: github.event_name == 'pull_request' && steps.previous-comment.outputs.comment-id
+ if: github.event_name == 'pull_request' && steps.previous-comment.outputs.comment-id && github.repository_owner == 'rome'
uses: peter-evans/create-or-update-comment@v1.4.5
continue-on-error: true
with:
@@ -79,7 +80,7 @@ jobs:
edit-mode: replace
- name: Write a new comment
- if: github.event_name == 'pull_request' && !steps.previous-comment.outputs.comment-id
+ if: github.event_name == 'pull_request' && !steps.previous-comment.outputs.comment-id && github.repository_owner == 'rome'
uses: peter-evans/create-or-update-comment@v1.4.5
continue-on-error: true
with:

Fix deploy playground to only run when repository is main Rome one and not a fork (#2510)