Skip to content

fix: prevent PR deployment without manual trigger #8882

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Aug 3, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix: do not deploy without a manual trigger
This will fix automatic first deployment
  • Loading branch information
matifali authored Aug 3, 2023
commit 9c757a01aa5050059d6ec34d3a313d64d2dfe767
5 changes: 3 additions & 2 deletions .github/workflows/pr-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ jobs:
needs: get_info
# Skips the build job if the workflow was triggered by a workflow_dispatch event and the skip_build input is set to true
# or if the workflow was triggered by an issue_comment event and the comment body contains --skip-build
# alwyas run the build job if the workflow was triggered by a pull_request event
# always run the build job if a pull_request event triggered the workflow
if: |
(github.event_name == 'workflow_dispatch' && github.event.inputs.skip_build == 'false') ||
(github.event_name == 'pull_request' && needs.get_info.outputs.NEW == 'false')
Expand Down Expand Up @@ -211,7 +211,8 @@ jobs:
deploy:
needs: [build, get_info]
# Run deploy job only if build job was successful or skipped
if: always() && (needs.build.result == 'success' || needs.build.result == 'skipped') && needs.get_info.result == 'success'
if: |
always() && (needs.build.result == 'success' || needs.build.result == 'skipped') && needs.get_info.outputs.NEW == 'false'
runs-on: "ubuntu-latest"
env:
CODER_IMAGE_TAG: ${{ needs.get_info.outputs.CODER_IMAGE_TAG }}
Expand Down