Skip to content

Commit

Permalink
adding breaking change label to container
Browse files Browse the repository at this point in the history
Signed-off-by: Javan lacerda <javanlacerda@google.com>
  • Loading branch information
javanlacerda committed Sep 23, 2024
1 parent f019ef6 commit 831689d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
18 changes: 17 additions & 1 deletion .github/workflows/container-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,21 @@ jobs:
- name: creds
run: gcloud auth configure-docker --quiet

- 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: KO_PREFIX=gcr.io/projectsigstore/fulcio/ci/fulcio make sign-keyless-ci
run: |
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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ $(PROTOC-API-LINTER): $(TOOLS_DIR)/go.mod
ko:
# fulcio
LDFLAGS="$(LDFLAGS)" GIT_HASH=$(GIT_HASH) GIT_VERSION=$(GIT_VERSION) \
KO_DOCKER_REPO=$(KO_PREFIX)/fulcio ko resolve --bare \
KO_DOCKER_REPO=$(KO_PREFIX)/fulcio ko resolve $(FORMATED_LABEL) --bare \
--platform=linux/amd64 --tags $(GIT_VERSION) --tags $(GIT_HASH) \
--image-refs fulcioImagerefs --filename config/ > $(FULCIO_YAML)

Expand Down

0 comments on commit 831689d

Please sign in to comment.