From f6e89f1a22230cf242b1e513538617dc3acfeaf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9mence=20Lesn=C3=A9?= Date: Fri, 12 Jan 2024 15:00:50 +0100 Subject: [PATCH 1/2] chore: Remove dead code --- .github/workflows/pipeline.yaml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/pipeline.yaml b/.github/workflows/pipeline.yaml index 254f19f8..66477485 100644 --- a/.github/workflows/pipeline.yaml +++ b/.github/workflows/pipeline.yaml @@ -117,13 +117,6 @@ jobs: org.opencontainers.image.documentation=https://github.com/${{ env.CONTAINER_NAME }} org.opencontainers.image.vendor=${{ github.actor }} - - name: Store tag - id: tag - run: | - branch=$(echo "${{ github.ref_name }}" | sed 's/\//-/g') - tag=$(echo "${{ steps.meta.outputs.tags }}" | grep -m1 $branch) - echo "tag=$tag" >> $GITHUB_OUTPUT - - name: Build/push container uses: docker/build-push-action@v5.1.0 with: From 4797ebc881c06a9b761109e66da9a6e81bd0842e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9mence=20Lesn=C3=A9?= Date: Fri, 12 Jan 2024 15:10:37 +0100 Subject: [PATCH 2/2] fix: Var default_branch is unreliable in some contexts --- .github/workflows/pipeline.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pipeline.yaml b/.github/workflows/pipeline.yaml index 66477485..b2953ad7 100644 --- a/.github/workflows/pipeline.yaml +++ b/.github/workflows/pipeline.yaml @@ -178,7 +178,7 @@ jobs: uses: actions/github-script@v7.0.1 with: script: | - const isMain = context.ref == `refs/heads/${context.payload.repository.default_branch}`; + const isMain = context.ref == `refs/heads/main`; const repoName = context.repo.repo; console.log(isMain ? 'Creating release for default branch' : 'Creating release for non-default branch'); @@ -205,7 +205,7 @@ jobs: - create-release - init # Only publish on non-scheduled default branch - if: (github.event_name != 'schedule') && (github.ref == 'refs/heads/${context.payload.repository.default_branch}') + if: (github.event_name != 'schedule') && (github.ref == 'refs/heads/main') steps: - name: publish release id: publish-release