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 4a65cb0
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 label for breaking change
id: breaking_change
run: |
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_LABEL="FORMATED_LABEL='--image-label breaking-change=true'"
else
FORMATED_LABEL="FORMATED_LABEL=" >> $GITHUB_OUTPUT
fi
echo $FORMATED_LABEL >> $GITHUB_OUTPUT
- name: container
run: KO_PREFIX=gcr.io/projectsigstore/fulcio/ci/fulcio make sign-keyless-ci
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
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 4a65cb0

Please sign in to comment.