-
Notifications
You must be signed in to change notification settings - Fork 0
fix(release): merge develop into main #195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
391140c
799c7bf
ae1c04f
42c97a9
2b1bbd8
81bbc20
6cca257
f42d549
f8f7e99
a3fb701
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -122,14 +122,24 @@ | |
| description: 'Force multi-platform build (amd64+arm64) even for beta/rc tags' | ||
| type: boolean | ||
| default: false | ||
| docker_build_args: | ||
| description: 'Newline-separated Docker build arguments to pass to docker build (e.g., "APP_NAME=spi\nCOMPONENT_NAME=api"). Forwarded to docker/build-push-action build-args.' | ||
| type: string | ||
| required: false | ||
| default: '' | ||
| build_context_from_working_dir: | ||
| description: 'Use the component working_dir as Docker build context instead of build_context. Useful for independent modules (e.g., tools with their own go.mod).' | ||
| type: boolean | ||
| default: false | ||
| enable_cosign_sign: | ||
| description: 'Sign container images with cosign keyless (OIDC) signing after push. Requires id-token: write permission in the caller.' | ||
| type: boolean | ||
| default: true | ||
|
|
||
| permissions: | ||
| contents: read | ||
| packages: write | ||
| id-token: write | ||
|
Comment on lines
139
to
+142
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Restrict The new signing path only runs in As per coding guidelines, "Always declare explicit least-privilege 🤖 Prompt for AI Agents |
||
|
|
||
| jobs: | ||
| prepare: | ||
|
|
@@ -283,6 +293,7 @@ | |
| type=semver,pattern={{major}},value=${{ steps.version.outputs.version }},enable=${{ needs.prepare.outputs.is_release }} | ||
|
|
||
| - name: Build and push Docker image | ||
| id: build-push | ||
| uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7 | ||
| with: | ||
| context: ${{ inputs.build_context_from_working_dir == true && matrix.app.working_dir || inputs.build_context }} | ||
|
|
@@ -291,14 +302,50 @@ | |
| push: true | ||
| tags: ${{ steps.meta.outputs.tags }} | ||
| labels: ${{ steps.meta.outputs.labels }} | ||
| build-args: ${{ inputs.docker_build_args }} | ||
| sbom: generator=docker/scout-sbom-indexer:latest | ||
| provenance: mode=max | ||
| cache-from: type=gha | ||
| cache-to: type=gha,mode=max | ||
| secrets: | | ||
| github_token=${{ secrets.MANAGE_TOKEN }} | ||
|
|
||
| # GitOps artifacts for downstream gitops-update workflow | ||
| # ----------------- Cosign Image Signing ----------------- | ||
| - name: Build cosign image references | ||
| if: inputs.enable_cosign_sign | ||
| id: cosign-refs | ||
| env: | ||
| DIGEST: ${{ steps.build-push.outputs.digest }} | ||
| ENABLE_DOCKERHUB: ${{ inputs.enable_dockerhub }} | ||
| ENABLE_GHCR: ${{ inputs.enable_ghcr }} | ||
| DOCKERHUB_ORG: ${{ inputs.dockerhub_org }} | ||
| APP_NAME: ${{ matrix.app.name }} | ||
| GHCR_ORG: ${{ steps.normalize.outputs.owner_lower }} | ||
| run: | | ||
| REFS="" | ||
|
|
||
| if [ "$ENABLE_DOCKERHUB" == "true" ]; then | ||
| REFS="${DOCKERHUB_ORG}/${APP_NAME}@${DIGEST}" | ||
| fi | ||
|
|
||
| if [ "$ENABLE_GHCR" == "true" ]; then | ||
| [ -n "$REFS" ] && REFS="${REFS}"$'\n' | ||
| REFS="${REFS}ghcr.io/${GHCR_ORG}/${APP_NAME}@${DIGEST}" | ||
| fi | ||
|
|
||
| { | ||
| echo "refs<<EOF" | ||
| echo "$REFS" | ||
| echo "EOF" | ||
| } >> "$GITHUB_OUTPUT" | ||
|
Comment on lines
+314
to
+340
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Custom
Suggested fix - name: Build cosign image references
if: inputs.enable_cosign_sign
id: cosign-refs
env:
DIGEST: ${{ steps.build-push.outputs.digest }}
ENABLE_DOCKERHUB: ${{ inputs.enable_dockerhub }}
ENABLE_GHCR: ${{ inputs.enable_ghcr }}
DOCKERHUB_ORG: ${{ inputs.dockerhub_org }}
APP_NAME: ${{ matrix.app.name }}
- GHCR_ORG: ${{ steps.normalize.outputs.owner_lower }}
+ INPUT_GHCR_ORG: ${{ inputs.ghcr_org }}
+ DEFAULT_GHCR_ORG: ${{ steps.normalize.outputs.owner_lower }}
run: |
REFS=""
+ GHCR_ORG="$INPUT_GHCR_ORG"
+ if [ -z "$GHCR_ORG" ]; then
+ GHCR_ORG="$DEFAULT_GHCR_ORG"
+ else
+ GHCR_ORG=$(echo "$GHCR_ORG" | tr '[:upper:]' '[:lower:]')
+ fi
if [ "$ENABLE_DOCKERHUB" == "true" ]; then
REFS="${DOCKERHUB_ORG}/${APP_NAME}@${DIGEST}"
fi🤖 Prompt for AI Agents |
||
|
|
||
| - name: Sign container images with cosign | ||
| if: inputs.enable_cosign_sign | ||
| uses: LerianStudio/github-actions-shared-workflows/src/security/cosign-sign@feat/cosign-sign | ||
| with: | ||
| image-refs: ${{ steps.cosign-refs.outputs.refs }} | ||
|
Comment on lines
+342
to
+346
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do not publish the workflow with A caller using a tagged or mainline revision of this reusable workflow would still execute action code from a mutable feature branch. That breaks release immutability and can fail once the branch moves or is deleted. As per coding guidelines, ".cursor/rules/reusable-workflows.mdc: External callers must use an org-owned ref pinned to a release tag (no 🧰 Tools🪛 GitHub Check: Pinned Actions Check[warning] 344-344: 🤖 Prompt for AI Agents |
||
|
|
||
| # ----------------- GitOps Artifacts ----------------- | ||
| - name: Create GitOps tag artifact | ||
| if: inputs.enable_gitops_artifacts | ||
| run: | | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -67,10 +67,15 @@ | |
| description: 'Enable release notifications' | ||
| type: boolean | ||
| default: false | ||
| enable_cosign_sign: | ||
| description: 'Sign container images with cosign keyless (OIDC) signing after push. Requires id-token: write permission in the caller.' | ||
| type: boolean | ||
| default: true | ||
|
|
||
| permissions: | ||
| contents: write | ||
| packages: write | ||
| id-token: write | ||
|
Comment on lines
75
to
+78
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Scope OIDC to the Only As per coding guidelines, "Always declare explicit least-privilege 🤖 Prompt for AI Agents |
||
|
|
||
| jobs: | ||
| release: | ||
|
|
@@ -164,6 +169,7 @@ | |
| tags: ${{ inputs.docker_tags }} | ||
|
|
||
| - name: Build and push | ||
| id: build-push | ||
| uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7 | ||
| with: | ||
| context: . | ||
|
|
@@ -174,6 +180,24 @@ | |
| cache-from: type=gha | ||
| cache-to: type=gha,mode=max | ||
|
|
||
| # ----------------- Cosign Image Signing ----------------- | ||
| - name: Build cosign image references | ||
| if: inputs.enable_cosign_sign | ||
| id: cosign-refs | ||
| env: | ||
| DIGEST: ${{ steps.build-push.outputs.digest }} | ||
| DOCKER_REGISTRY: ${{ inputs.docker_registry }} | ||
| REPOSITORY: ${{ github.repository }} | ||
| run: | | ||
| REPO=$(echo "$REPOSITORY" | tr '[:upper:]' '[:lower:]') | ||
| echo "refs=${DOCKER_REGISTRY}/${REPO}@${DIGEST}" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Sign container images with cosign | ||
| if: inputs.enable_cosign_sign | ||
| uses: LerianStudio/github-actions-shared-workflows/src/security/cosign-sign@feat/cosign-sign | ||
| with: | ||
| image-refs: ${{ steps.cosign-refs.outputs.refs }} | ||
|
Comment on lines
+195
to
+199
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do not publish the workflow with A caller using a tagged or mainline revision of this reusable workflow would still execute action code from a mutable feature branch. That breaks release immutability and can fail once the branch moves or is deleted. As per coding guidelines, ".cursor/rules/reusable-workflows.mdc: External callers must use an org-owned ref pinned to a release tag (no 🧰 Tools🪛 GitHub Check: Pinned Actions Check[warning] 197-197: 🤖 Prompt for AI Agents |
||
|
|
||
| # Slack notification | ||
| notify: | ||
| name: Notify | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reconcile the
workflow_dispatchrule in this document.This rules refresh lands in a file that still tells agents reusable workflows must support
workflow_dispatch. Current repo policy for externally consumed reusable workflows is the opposite, so the document now gives conflicting instructions and will drive incorrect edits.Based on learnings, "reusable workflows under
.github/workflowsmust NOT include aworkflow_dispatchtrigger."🤖 Prompt for AI Agents