From f816814e876a2d8e0fe45ca6212e019ae047d261 Mon Sep 17 00:00:00 2001 From: Jan Fajerski Date: Thu, 5 Mar 2026 15:31:32 +0000 Subject: [PATCH] fix: fall back to github.token when REPOSITORY_PUSH_TOKEN is unset actions/checkout@v6 now fails hard when passed an empty token string rather than silently falling back to GITHUB_TOKEN. Use the || operator to fall back to github.token when REPOSITORY_PUSH_TOKEN is not defined. Co-Authored-By: Claude Sonnet 4.6 (1M context) --- .github/workflows/olm-stable.yaml | 4 ++-- .github/workflows/release-branch.yaml | 6 +++--- .github/workflows/release.yaml | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/olm-stable.yaml b/.github/workflows/olm-stable.yaml index cde0540dc..45956efed 100644 --- a/.github/workflows/olm-stable.yaml +++ b/.github/workflows/olm-stable.yaml @@ -30,7 +30,7 @@ jobs: with: ref: ${{ steps.branch.outputs.name }} fetch-depth: 0 - token: ${{ secrets.REPOSITORY_PUSH_TOKEN }} + token: ${{ secrets.REPOSITORY_PUSH_TOKEN || github.token }} - name: Setup Go environment uses: actions/setup-go@v6 @@ -51,7 +51,7 @@ jobs: - name: Open catalog PR env: - GH_TOKEN: ${{ secrets.REPOSITORY_PUSH_TOKEN }} + GH_TOKEN: ${{ secrets.REPOSITORY_PUSH_TOKEN || github.token }} run: | git config user.name rhobs-release-bot git config user.email release-bot@monitoring.rhobs.io diff --git a/.github/workflows/release-branch.yaml b/.github/workflows/release-branch.yaml index 8748aec6e..649745a77 100644 --- a/.github/workflows/release-branch.yaml +++ b/.github/workflows/release-branch.yaml @@ -30,7 +30,7 @@ jobs: uses: actions/checkout@v6 with: fetch-depth: 0 - token: ${{ secrets.REPOSITORY_PUSH_TOKEN }} + token: ${{ secrets.REPOSITORY_PUSH_TOKEN || github.token }} persist-credentials: false # standard-version's release-as relies on controller-gen for code generation. @@ -72,7 +72,7 @@ jobs: uses: actions/checkout@v6 with: fetch-depth: 0 - token: ${{ secrets.REPOSITORY_PUSH_TOKEN }} + token: ${{ secrets.REPOSITORY_PUSH_TOKEN || github.token }} - name: Setup Go environment uses: actions/setup-go@v6 @@ -100,7 +100,7 @@ jobs: - name: Open catalog PR env: - GH_TOKEN: ${{ secrets.REPOSITORY_PUSH_TOKEN }} + GH_TOKEN: ${{ secrets.REPOSITORY_PUSH_TOKEN || github.token }} run: | git config user.name rhobs-release-bot git config user.email release-bot@monitoring.rhobs.io diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index ba7c477c3..d052b5b8b 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -28,7 +28,7 @@ jobs: - uses: actions/checkout@v6 with: fetch-depth: 0 - token: ${{ secrets.REPOSITORY_PUSH_TOKEN }} + token: ${{ secrets.REPOSITORY_PUSH_TOKEN || github.token }} # Bumping the version in the next step will also run code generation scripts # that depend on controller-gen. @@ -60,7 +60,7 @@ jobs: - name: Open catalog PR env: - GH_TOKEN: ${{ secrets.REPOSITORY_PUSH_TOKEN }} + GH_TOKEN: ${{ secrets.REPOSITORY_PUSH_TOKEN || github.token }} run: | git config user.name rhobs-release-bot git config user.email release-bot@monitoring.rhobs.io