From 7c69200d1c877db280c36cf3257b9dbfc6fb470a Mon Sep 17 00:00:00 2001 From: Guillaume Smet Date: Mon, 19 Aug 2024 19:24:43 +0200 Subject: [PATCH] Do not use the branch for forks For forks, let's use a 'fork' suffix common to all branches as the push events will target feature branches. (cherry picked from commit 5b4188b1f9031909e92a4e942312cee1f2f6bdb6) --- .github/workflows/ci-actions-incremental.yml | 2 +- .github/workflows/deploy-snapshots.yml | 2 +- .github/workflows/doc-build.yml | 2 +- .github/workflows/native-it-selected-graalvm.yml | 2 +- .github/workflows/owasp-check.yml | 2 +- .github/workflows/podman-build.yml | 2 +- .github/workflows/sonarcloud.yml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci-actions-incremental.yml b/.github/workflows/ci-actions-incremental.yml index 276b4531a83a9..1d37bc505f722 100644 --- a/.github/workflows/ci-actions-incremental.yml +++ b/.github/workflows/ci-actions-incremental.yml @@ -130,7 +130,7 @@ jobs: - name: Generate cache key id: cache-key run: | - CURRENT_BRANCH="${{ github.base_ref || github.ref_name }}" + CURRENT_BRANCH="${{ github.repository != 'quarkusio/quarkus' && 'fork' || github.base_ref || github.ref_name }}" CURRENT_MONTH=$(/bin/date -u "+%Y-%m") ROOT_CACHE_KEY="m2-cache" echo "m2-monthly-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}" >> $GITHUB_OUTPUT diff --git a/.github/workflows/deploy-snapshots.yml b/.github/workflows/deploy-snapshots.yml index f17ed78f505d9..2b2d89cc9987e 100644 --- a/.github/workflows/deploy-snapshots.yml +++ b/.github/workflows/deploy-snapshots.yml @@ -28,7 +28,7 @@ jobs: - name: Generate cache key id: cache-key run: | - CURRENT_BRANCH="${{ github.base_ref || github.ref_name }}" + CURRENT_BRANCH="${{ github.repository != 'quarkusio/quarkus' && 'fork' || github.base_ref || github.ref_name }}" CURRENT_MONTH=$(/bin/date -u "+%Y-%m") ROOT_CACHE_KEY="m2-cache" echo "m2-monthly-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}" >> $GITHUB_OUTPUT diff --git a/.github/workflows/doc-build.yml b/.github/workflows/doc-build.yml index b5383fb3fbbfd..5068bd8b31229 100644 --- a/.github/workflows/doc-build.yml +++ b/.github/workflows/doc-build.yml @@ -61,7 +61,7 @@ jobs: - name: Generate cache key id: cache-key run: | - CURRENT_BRANCH="${{ github.base_ref || github.ref_name }}" + CURRENT_BRANCH="${{ github.repository != 'quarkusio/quarkus' && 'fork' || github.base_ref || github.ref_name }}" CURRENT_MONTH=$(/bin/date -u "+%Y-%m") ROOT_CACHE_KEY="m2-cache" echo "m2-monthly-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}" >> $GITHUB_OUTPUT diff --git a/.github/workflows/native-it-selected-graalvm.yml b/.github/workflows/native-it-selected-graalvm.yml index 89fc7b6d53daf..319a4e831b81a 100644 --- a/.github/workflows/native-it-selected-graalvm.yml +++ b/.github/workflows/native-it-selected-graalvm.yml @@ -77,7 +77,7 @@ jobs: - name: Generate cache key id: cache-key run: | - CURRENT_BRANCH="${{ github.base_ref || github.ref_name }}" + CURRENT_BRANCH="${{ github.repository != 'quarkusio/quarkus' && 'fork' || github.base_ref || github.ref_name }}" CURRENT_MONTH=$(/bin/date -u "+%Y-%m") ROOT_CACHE_KEY="m2-cache" echo "m2-monthly-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}" >> $GITHUB_OUTPUT diff --git a/.github/workflows/owasp-check.yml b/.github/workflows/owasp-check.yml index eb3f640ce02fc..be8e2b9e987fb 100644 --- a/.github/workflows/owasp-check.yml +++ b/.github/workflows/owasp-check.yml @@ -29,7 +29,7 @@ jobs: - name: Generate cache key id: cache-key run: | - CURRENT_BRANCH="${{ github.base_ref || github.ref_name }}" + CURRENT_BRANCH="${{ github.repository != 'quarkusio/quarkus' && 'fork' || github.base_ref || github.ref_name }}" CURRENT_MONTH=$(/bin/date -u "+%Y-%m") ROOT_CACHE_KEY="m2-cache" echo "m2-monthly-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}" >> $GITHUB_OUTPUT diff --git a/.github/workflows/podman-build.yml b/.github/workflows/podman-build.yml index 59fdbe2e21dd2..1a0bba62021a1 100644 --- a/.github/workflows/podman-build.yml +++ b/.github/workflows/podman-build.yml @@ -84,7 +84,7 @@ jobs: - name: Generate cache key id: cache-key run: | - CURRENT_BRANCH="${{ github.base_ref || github.ref_name }}" + CURRENT_BRANCH="${{ github.repository != 'quarkusio/quarkus' && 'fork' || github.base_ref || github.ref_name }}" CURRENT_MONTH=$(/bin/date -u "+%Y-%m") ROOT_CACHE_KEY="m2-cache" echo "m2-monthly-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}" >> $GITHUB_OUTPUT diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index 8d420f4546344..9c3ae07a62cb8 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -19,7 +19,7 @@ jobs: - name: Generate cache key id: cache-key run: | - CURRENT_BRANCH="${{ github.base_ref || github.ref_name }}" + CURRENT_BRANCH="${{ github.repository != 'quarkusio/quarkus' && 'fork' || github.base_ref || github.ref_name }}" CURRENT_MONTH=$(/bin/date -u "+%Y-%m") ROOT_CACHE_KEY="m2-cache" echo "m2-monthly-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}" >> $GITHUB_OUTPUT