CI (upload-dev-build): Correctly get PR number for forks, and exit workflow if PR number or SHA is empty#7806
Open
emilykl wants to merge 2 commits into
Open
CI (upload-dev-build): Correctly get PR number for forks, and exit workflow if PR number or SHA is empty#7806emilykl wants to merge 2 commits into
emilykl wants to merge 2 commits into
Conversation
camdecoster
previously approved these changes
May 20, 2026
Contributor
camdecoster
left a comment
There was a problem hiding this comment.
I think you need to update the displayed URL too for the post build message.
| echo "Builds for PR #${{ steps.setup-metadata.outputs.PR_NUM }} can be accessed at:" >> $GITHUB_STEP_SUMMARY | ||
| echo "- Latest build for this PR: [$BASE/latest/plotly.min.js]($BASE/latest/plotly.min.js)" >> $GITHUB_STEP_SUMMARY | ||
| echo "- Build for this commit: [$BASE/${{ steps.setup-metadata.outputs.SHA }}/plotly.min.js]($BASE/${{ steps.setup-metadata.outputs.SHA }}/plotly.min.js)" >> $GITHUB_STEP_SUMMARY | ||
| echo "- Build for this commit: [$BASE/${{ steps.setup-metadata.outputs.SHA }}/plotly.min.js]($BASE/${{ steps.setup-metadata.outputs.SHORT_SHA }}/plotly.min.js)" >> $GITHUB_STEP_SUMMARY |
Contributor
There was a problem hiding this comment.
Suggested change
| echo "- Build for this commit: [$BASE/${{ steps.setup-metadata.outputs.SHA }}/plotly.min.js]($BASE/${{ steps.setup-metadata.outputs.SHORT_SHA }}/plotly.min.js)" >> $GITHUB_STEP_SUMMARY | |
| echo "- Build for this commit: [$BASE/${{ steps.setup-metadata.outputs.SHORT_SHA }}/plotly.min.js]($BASE/${{ steps.setup-metadata.outputs.SHORT_SHA }}/plotly.min.js)" >> $GITHUB_STEP_SUMMARY |
Contributor
Author
There was a problem hiding this comment.
Good catch -- updated!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #7805
upload-dev-buildworkflow:ghCLI to get PR number for forks (github.event.workflow_run.pull_requests[0].numberdoes not work for forks)Steps for testing
The
workflow_runtrigger scenario (normal case) can't be directly tested until onmasterdue to GitHub Actions security measures. However, the key aspects of this change can be manually verified:Verifying that the workflow fails if PR number is empty
fail-if-no-pr-numberfrom the dropdown)26179043520for Run IDVerifying the
ghCLI command for getting the PR numberplotly.jsrepo root directory:gh pr list --search "sha:b7a0c06e08cfa147d235d6a470cde4bfb7549e98" --state open --json number --jq '.[0].number'7804b7a0c06e08cfa147d235d6a470cde4bfb7549e98matches a commit in a fork of Plotly.js, and it is part of PR number 7804: Draft PR for testing workflows #7804