chore(ci): get pr number and sha from github context#35405
chore(ci): get pr number and sha from github context#35405mergify[bot] merged 2 commits intoaws:mainfrom
Conversation
7f0dfb1 to
5ff1452
Compare
| run: | | ||
| if [[ ! -f pr/pr_number ]]; then | ||
| echo "${{ github.event.pull_request.number }}" > pr/pr_number | ||
| echo "${{ github.event.workflow_run.pull_requests[0].number }}" > pr/pr_number |
There was a problem hiding this comment.
This operation feels unsafe to me. What happens if the element I am trying to access do not exist?
There was a problem hiding this comment.
It resolves to echo "" > pr/pr_number, see this run: https://github.com/leonmk-aws/aws-cdk/actions/runs/17497346723/ (if you look at the workflow file I tried to workflow_run.pull_requests[10] which doesn't exist)
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
|
This pull request has been removed from the queue for the following reason: The pull request can't be updated. You should update or rebase your pull request manually. If you do, this pull request will automatically be requeued once the queue conditions match again. |
|
@Mergifyio update |
❌ Mergify doesn't have permission to updateDetailsFor security reasons, Mergify can't update this pull request. Try updating locally. |
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
|
Comments on closed issues and PRs are hard for our team to see. |
Issue # (if applicable)
Related to #35268 as the previous fix didn't fully work
Reason for this change
The Pr linter workflow does not reach the code of the linter itself because it stop on error when being triggered at the end of a build, see the following run for example.
Description of changes
Continue if
'Download workflow_run artifact'to get the PR number and the pr sha from the Github context.Description of how you validated changes
Ran on my fork of the repo (canceling the build workflow retriggers this one), see the following run for example: https://github.com/leonmk-aws/aws-cdk/actions/runs/17435786087/job/49505111010
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license