From 49d7af0435bd8405b7d2d41fee401896c52edcea Mon Sep 17 00:00:00 2001 From: Javan lacerda Date: Fri, 20 Sep 2024 18:00:15 +0000 Subject: [PATCH 1/4] adding breaking change label to container Signed-off-by: Javan lacerda --- .github/workflows/container-build.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/container-build.yml b/.github/workflows/container-build.yml index 9b5d66ff3..170209755 100644 --- a/.github/workflows/container-build.yml +++ b/.github/workflows/container-build.yml @@ -67,7 +67,21 @@ jobs: fi echo $FORMATED_LABEL >> $GITHUB_OUTPUT + - name: Formatted labels + id: labels + run: | + FORMATED_LABELS="FORMATED_LABELS='--image-label commit-hash=$GITHUB_SHA" + + BRANCH_NUMBER=$(gh pr list --state all --search "sha:$GITHUB_SHA" --label "breaking-change" | awk '{print $1}') + echo "Branch Number: $BRANCH_NUMBER" + + # Check if a pull request number was found + if [ -n "$BRANCH_NUMBER" ]; then + FORMATED_LABELS+=" --image-label breaking-change=true" + fi + echo $FORMATED_LABELS >> $GITHUB_OUTPUT + - name: container run: | - echo "Formated Label: ${{ steps.breaking_change.outputs.FORMATED_LABEL }}" - KO_PREFIX=gcr.io/projectsigstore/fulcio/ci/fulcio FORMATED_LABEL=${{ steps.breaking_change.outputs.FORMATED_LABEL }} make sign-keyless-ci + echo "Formated Label: ${{ steps.labels.outputs.FORMATED_LABELS }}" + KO_PREFIX=gcr.io/projectsigstore/fulcio/ci/fulcio FORMATED_LABEL=${{ steps.labels.outputs.FORMATED_LABELS }} make sign-keyless-ci From 4158ba1e743b4a095abc87993577ab09fba9a9e9 Mon Sep 17 00:00:00 2001 From: Javan lacerda Date: Mon, 23 Sep 2024 14:41:23 +0000 Subject: [PATCH 2/4] test Signed-off-by: Javan lacerda --- .github/workflows/container-build.yml | 1 + Makefile | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/container-build.yml b/.github/workflows/container-build.yml index 170209755..64a8f23e3 100644 --- a/.github/workflows/container-build.yml +++ b/.github/workflows/container-build.yml @@ -56,6 +56,7 @@ jobs: - name: Formatted label for breaking change id: breaking_change run: | + # Get the pull request number associated with the current commit and the 'breaking-change' label BRANCH_NUMBER=$(gh pr list --state all --search "sha:$GITHUB_SHA" | awk '{print $1}') echo "Branch Number: $BRANCH_NUMBER" diff --git a/Makefile b/Makefile index 9024d2be9..0fbf86bcc 100644 --- a/Makefile +++ b/Makefile @@ -124,6 +124,7 @@ ko: LDFLAGS="$(LDFLAGS)" GIT_HASH=$(GIT_HASH) GIT_VERSION=$(GIT_VERSION) \ KO_DOCKER_REPO=$(KO_PREFIX)/fulcio ko resolve $(FORMATED_LABEL) --bare \ --platform=linux/amd64 --tags $(GIT_VERSION) --tags $(GIT_HASH) \ + $(FORMATED_LABEL) \ --image-refs fulcioImagerefs --filename config/ > $(FULCIO_YAML) .PHONY: ko-local From e686253fad50a05000c42bc2769d7cb4b125bf44 Mon Sep 17 00:00:00 2001 From: Javan lacerda Date: Mon, 23 Sep 2024 13:26:55 +0000 Subject: [PATCH 3/4] test2 Signed-off-by: Javan lacerda --- Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/Makefile b/Makefile index 0fbf86bcc..9024d2be9 100644 --- a/Makefile +++ b/Makefile @@ -124,7 +124,6 @@ ko: LDFLAGS="$(LDFLAGS)" GIT_HASH=$(GIT_HASH) GIT_VERSION=$(GIT_VERSION) \ KO_DOCKER_REPO=$(KO_PREFIX)/fulcio ko resolve $(FORMATED_LABEL) --bare \ --platform=linux/amd64 --tags $(GIT_VERSION) --tags $(GIT_HASH) \ - $(FORMATED_LABEL) \ --image-refs fulcioImagerefs --filename config/ > $(FULCIO_YAML) .PHONY: ko-local From 23cf5b8ca9977718ed67b8582a57d6b77bf0fd4a Mon Sep 17 00:00:00 2001 From: Javan lacerda Date: Mon, 23 Sep 2024 14:55:45 +0000 Subject: [PATCH 4/4] test Signed-off-by: Javan lacerda --- .github/workflows/container-build.yml | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/.github/workflows/container-build.yml b/.github/workflows/container-build.yml index 64a8f23e3..8441e0fb8 100644 --- a/.github/workflows/container-build.yml +++ b/.github/workflows/container-build.yml @@ -52,28 +52,12 @@ jobs: - uses: ko-build/setup-ko@3aebd0597dc1e9d1a26bcfdb7cbeb19c131d3037 # v0.7 - - - name: Formatted label for breaking change - id: breaking_change - run: | - # Get the pull request number associated with the current commit and the 'breaking-change' label - BRANCH_NUMBER=$(gh pr list --state all --search "sha:$GITHUB_SHA" | awk '{print $1}') - echo "Branch Number: $BRANCH_NUMBER" - - # Check if a pull request number was found - if [ -n "$BRANCH_NUMBER" ]; then - FORMATED_LABEL="FORMATED_LABEL='--image-label breaking-change=true'" - else - FORMATED_LABEL="FORMATED_LABEL=" >> $GITHUB_OUTPUT - fi - echo $FORMATED_LABEL >> $GITHUB_OUTPUT - - name: Formatted labels id: labels run: | - FORMATED_LABELS="FORMATED_LABELS='--image-label commit-hash=$GITHUB_SHA" + FORMATED_LABELS="FORMATED_LABELS='--image-label commit-hash=$GITHUB_SHA'" - BRANCH_NUMBER=$(gh pr list --state all --search "sha:$GITHUB_SHA" --label "breaking-change" | awk '{print $1}') + BRANCH_NUMBER=$(gh pr list --state all --search "sha:$GITHUB_SHA" | awk '{print $1}') echo "Branch Number: $BRANCH_NUMBER" # Check if a pull request number was found