From 857d9204d4c9170a8815579208f71d99b9c58188 Mon Sep 17 00:00:00 2001 From: Alex Snaps Date: Tue, 10 Dec 2024 06:10:22 -0500 Subject: [PATCH 1/2] Only run some actions on main repo Signed-off-by: Alex Snaps --- .github/workflows/build-image.yaml | 4 ++++ .github/workflows/coverage.yml | 2 ++ .github/workflows/license-scan.yaml | 1 + .github/workflows/release.yaml | 1 + 4 files changed, 8 insertions(+) diff --git a/.github/workflows/build-image.yaml b/.github/workflows/build-image.yaml index 4820cbdf..306e9b5c 100644 --- a/.github/workflows/build-image.yaml +++ b/.github/workflows/build-image.yaml @@ -100,19 +100,23 @@ jobs: # set ref name tag for non-main branches type=raw,value=${{ github.ref_name }},enable=${{ github.ref_name != env.MAIN_BRANCH_NAME }} - name: Login to container registry + if: github.repository == 'Kuadrant/limitador' uses: docker/login-action@v2 with: username: ${{ secrets.IMG_REGISTRY_USERNAME }} password: ${{ secrets.IMG_REGISTRY_TOKEN }} registry: ${{ env.IMG_REGISTRY_HOST }} - name: Create manifest list and push + if: github.repository == 'Kuadrant/limitador' working-directory: /tmp/digests run: | docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ $(printf '${{ env.IMG_REGISTRY_HOST }}/${{ env.IMG_REGISTRY_ORG }}/limitador@sha256:%s ' $(find . -type f -exec basename {} \;)) - name: Inspect image + if: github.repository == 'Kuadrant/limitador' run: | docker buildx imagetools inspect ${{ env.IMG_REGISTRY_HOST }}/${{ env.IMG_REGISTRY_ORG }}/limitador:${{ steps.meta.outputs.version }} - name: Smoke Test + if: github.repository == 'Kuadrant/limitador' run: | docker run --rm -t ${{ env.IMG_REGISTRY_HOST }}/${{ env.IMG_REGISTRY_ORG }}/limitador:${{ steps.meta.outputs.version }} limitador-server --help diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 847ee72f..5308208a 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -9,6 +9,7 @@ on: jobs: check: name: Check + if: github.repository == 'Kuadrant/limitador' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -23,6 +24,7 @@ jobs: test: name: Test Suite + if: github.repository == 'Kuadrant/limitador' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/license-scan.yaml b/.github/workflows/license-scan.yaml index f889b429..e917d822 100644 --- a/.github/workflows/license-scan.yaml +++ b/.github/workflows/license-scan.yaml @@ -12,6 +12,7 @@ on: jobs: fossa-scan: name: Find license compliance and security issues + if: github.repository == 'Kuadrant/limitador' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 3bf8d7a4..a701561d 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -12,6 +12,7 @@ on: jobs: publish: name: Publish Limitador crate to crates.io + if: github.repository == 'Kuadrant/limitador' runs-on: ubuntu-latest steps: - uses: abelfodil/protoc-action@v1 From 2f15df86078fb1853093a2b0a75936fe41db0172 Mon Sep 17 00:00:00 2001 From: Alex Snaps Date: Tue, 10 Dec 2024 06:54:31 -0500 Subject: [PATCH 2/2] Like this makes sense Signed-off-by: Alex Snaps --- .github/workflows/license-scan.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/license-scan.yaml b/.github/workflows/license-scan.yaml index e917d822..51cec916 100644 --- a/.github/workflows/license-scan.yaml +++ b/.github/workflows/license-scan.yaml @@ -12,7 +12,7 @@ on: jobs: fossa-scan: name: Find license compliance and security issues - if: github.repository == 'Kuadrant/limitador' + if: github.repository == 'Kuadrant/limitador' && secrets.FOSSA_API_TOKEN != null runs-on: ubuntu-latest steps: - uses: actions/checkout@v4