From 59f805883116faf7418dc4e7fae22464fb24ab2a Mon Sep 17 00:00:00 2001 From: Nick Boldt Date: Mon, 29 Jan 2024 14:00:03 -0400 Subject: [PATCH] move env.CHANGES check to substages as that's where env is defined Signed-off-by: Nick Boldt --- .github/workflows/next-container-build.yaml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/next-container-build.yaml b/.github/workflows/next-container-build.yaml index 66e546ed..c48797bf 100644 --- a/.github/workflows/next-container-build.yaml +++ b/.github/workflows/next-container-build.yaml @@ -60,8 +60,6 @@ jobs: name: Next build runs-on: ubuntu-latest needs: check-changes - # run this stage only if there are changes that match the includes and not the excludes - if: ${{ env.CHANGES != '' }} permissions: contents: read packages: write @@ -73,11 +71,15 @@ jobs: fetch-depth: 0 - name: Setup Go - uses: actions/setup-go@v4 + # run this stage only if there are changes that match the includes and not the excludes + if: ${{ env.CHANGES != '' }} + uses: actions/setup-go@v5 with: go-version-file: 'go.mod' - name: Get the last commit short SHA + # run this stage only if there are changes that match the includes and not the excludes + if: ${{ env.CHANGES != '' }} run: | SHORT_SHA=$(git rev-parse --short HEAD) echo "SHORT_SHA=$SHORT_SHA" >> $GITHUB_ENV @@ -85,6 +87,8 @@ jobs: echo "BASE_VERSION=$BASE_VERSION" >> $GITHUB_ENV - name: Login to quay.io + # run this stage only if there are changes that match the includes and not the excludes + if: ${{ env.CHANGES != '' }} uses: docker/login-action@v2 with: registry: ${{ env.REGISTRY }} @@ -92,6 +96,8 @@ jobs: password: ${{ secrets.QUAY_TOKEN }} - name: Build and push operator, bundle, and catalog images + # run this stage only if there are changes that match the includes and not the excludes + if: ${{ env.CHANGES != '' }} run: | # install skopeo, podman sudo apt-get -y update; sudo apt-get -y install skopeo podman