From c67e1a5541297727cfdcd0abd4a0399449bf18ed Mon Sep 17 00:00:00 2001 From: Antony Reynaud Date: Mon, 16 Sep 2024 13:11:58 +0000 Subject: [PATCH] fix: repository value renovate update workflow [ upstream commit 523c7be5702823a6b0827a62f6c0844e6de191c7 ] 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: https://github.com/cilium/cilium/pull/34650 Signed-off-by: Antony Reynaud Signed-off-by: Yutaro Hayakawa --- .github/workflows/build-images-base.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-images-base.yaml b/.github/workflows/build-images-base.yaml index 2403da8d7017a..87bf6e25a160b 100644 --- a/.github/workflows/build-images-base.yaml +++ b/.github/workflows/build-images-base.yaml @@ -290,7 +290,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^