-
Notifications
You must be signed in to change notification settings - Fork 5
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
ci(surge-deploy): get artifact from the specific workflow run #744
Conversation
Previously, this wasn't set in `dawidd6/action-download-artifact` so the action was doing a search to retrieve the artifact. It was using default search parameters, so it skip workflow runs for PR from forks, and always considered the latest run of the workflow. So, when several PR was opened simultaneously, a wrong artifact could be retrieved. In addition, don't run the deployment workflow if the build step failed. Fix the fix, the deployment would fail because no artifact is available for download.
Quality Gate passedIssues Measures |
🎊 PR Preview 02d7519 has been successfully built and deployed to https://bonitasoft-bonita-documentation-site-test-pr-744.surge.sh 🕐 Build time: 0.01s 🤖 By surge-preview |
🎊 PR Preview 02d7519 has been successfully built and deployed to https://bonitasoft-bonita-documentation-site-deploy-pr-744.surge.sh 🕐 Build time: 0.009s 🤖 By surge-preview |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done 👏
@@ -13,12 +13,14 @@ jobs: | |||
# IMPORTANT: the logic is duplicated in the `surge-deploy-pr-preview-test.yml` workflow. Keep both definitions in sync. | |||
deploy: | |||
runs-on: ubuntu-22.04 | |||
if: ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thought: we already did that in the workflow we used to validate the solution but miss it here (probably a mistake)
See https://github.com/process-analytics/github-actions-playground/blob/56add9dacc916c898c609fbe480bd7ceb2ba353c/.github/workflows/surge-pr-fork-02-deploy.yml#L15-L17
Previously, this wasn't set in
dawidd6/action-download-artifact
so theaction was doing a search to retrieve the artifact.
It was using default search parameters, so it skip workflow runs for PR
from forks, and always considered the latest run of the workflow.
So, when several PR was opened simultaneously, a wrong artifact could be
retrieved.
In addition, don't run the deployment workflow if the build step failed.
Fix the fix, the deployment would fail because no artifact is available for download.
Notes
Fixes #741
Validated with process-analytics/github-actions-playground#363 (comment)
About the addition of a condition to run the workflow
https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#running-a-workflow-based-on-the-conclusion-of-another-workflow