Skip to content

Commit

Permalink
fix: repository value renovate update workflow
Browse files Browse the repository at this point in the history
[ upstream commit 523c7be ]

github.head_ref is only available when the workflow context is pull_request or pull_request_target
cf https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/accessing-contextual-information-about-workflow-runs

since head_ref was nil, the conditional `${{ startsWith(github.head_ref, 'renovate/') && github.repository || github.event.pull_request.head.repo.full_name }}`
would then point to `pull_request.head.repo.full_name` which was also nil because of the context being workflow_dispatch and not pull_request_target or pull_request

this commit revert the repository conditional creation to `github.event.pull_request.head.repo.full_name || github.repository`, as `github.repository` will only be used
out of a pull request event (here, workflow_dispatch), and the only workflow_dispatch context usage would be coming from renovate branches that are protected by renovate environment

fixes: cilium#34650

Signed-off-by: Antony Reynaud <[email protected]>
Signed-off-by: Yutaro Hayakawa <[email protected]>
  • Loading branch information
Artyop authored and YutaroHayakawa committed Sep 25, 2024
1 parent dfd54c0 commit b084052
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/build-images-base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ jobs:
- name: Push changes into PR
env:
ref: ${{ github.event.pull_request.head.ref || github.ref }}
repository: ${{ startsWith(github.head_ref, 'renovate/') && github.repository || github.event.pull_request.head.repo.full_name }}
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
if: ${{ steps.cilium-runtime-tag-in-repositories.outputs.exists == 'false' || steps.cilium-builder-tag-in-repositories.outputs.exists == 'false' }}
run: |
git diff HEAD^
Expand Down

0 comments on commit b084052

Please sign in to comment.