Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .cursor/rules/reusable-workflows.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ runs-on: self-hosted

Every reusable workflow must:
- support `workflow_call` (for external callers)
- support `workflow_dispatch` (for manual testing)
- expose explicit `inputs` — never rely on implicit context
- **must NOT** include a `workflow_dispatch` trigger — if manual/interactive dispatch is needed, create a separate self-workflow under `.github/workflows/self-*`
- **always include a `dry_run` input** (`type: boolean`, `default: false`) so the workflow can be safely tested before applying real changes

```yaml
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ on:
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.'
description: 'Newline-separated Docker build arguments (e.g., "APP_NAME=spi\nCOMPONENT_NAME=api"). For sensitive values (tokens, keys, passwords), use BuildKit secrets instead — build arguments are visible in image history.'
type: string
required: false
default: ''
Expand All @@ -139,7 +139,6 @@ on:
permissions:
contents: read
packages: write
id-token: write

jobs:
prepare:
Expand Down Expand Up @@ -208,6 +207,10 @@ jobs:
if: needs.prepare.outputs.has_builds == 'true'
runs-on: ${{ inputs.runner_type }}
name: Build ${{ matrix.app.name }}
permissions:
contents: read
packages: write
id-token: write
strategy:
max-parallel: 2
fail-fast: false
Expand Down Expand Up @@ -320,7 +323,7 @@ jobs:
ENABLE_GHCR: ${{ inputs.enable_ghcr }}
DOCKERHUB_ORG: ${{ inputs.dockerhub_org }}
APP_NAME: ${{ matrix.app.name }}
GHCR_ORG: ${{ steps.normalize.outputs.owner_lower }}
GHCR_ORG: ${{ inputs.ghcr_org || steps.normalize.outputs.owner_lower }}
run: |
REFS=""

Expand All @@ -341,7 +344,7 @@ jobs:

- name: Sign container images with cosign
if: inputs.enable_cosign_sign
uses: LerianStudio/github-actions-shared-workflows/src/security/cosign-sign@feat/cosign-sign
uses: LerianStudio/github-actions-shared-workflows/src/security/cosign-sign@v1.23.0
with:
image-refs: ${{ steps.cosign-refs.outputs.refs }}

Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/go-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ on:
permissions:
contents: write
packages: write
id-token: write

jobs:
release:
Expand Down Expand Up @@ -144,6 +143,10 @@ jobs:
docker:
name: Build and Push Docker Image
runs-on: ${{ inputs.runner_type }}
permissions:
contents: read
packages: write
id-token: write
needs: release
if: inputs.enable_docker && startsWith(github.ref, 'refs/tags/v')

Expand Down Expand Up @@ -194,7 +197,7 @@ jobs:

- name: Sign container images with cosign
if: inputs.enable_cosign_sign
uses: LerianStudio/github-actions-shared-workflows/src/security/cosign-sign@feat/cosign-sign
uses: LerianStudio/github-actions-shared-workflows/src/security/cosign-sign@v1.23.0
with:
image-refs: ${{ steps.cosign-refs.outputs.refs }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-security-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ on:
type: boolean
default: true
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.'
description: 'Newline-separated Docker build arguments (e.g., "APP_NAME=spi\nCOMPONENT_NAME=api"). For sensitive values (tokens, keys, passwords), use BuildKit secrets instead — build arguments are visible in image history.'
type: string
required: false
default: ''
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/typescript-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ on:
permissions:
contents: read
packages: write
id-token: write

jobs:
prepare:
Expand Down Expand Up @@ -250,6 +249,10 @@ jobs:
if: needs.prepare.outputs.has_builds == 'true'
runs-on: ${{ inputs.runner_type }}
name: Build ${{ matrix.app.name }}
permissions:
contents: read
packages: write
id-token: write
strategy:
max-parallel: 2
fail-fast: false
Expand Down Expand Up @@ -333,7 +336,7 @@ jobs:

- name: Sign container images with cosign
if: inputs.enable_cosign_sign && !inputs.dry_run && steps.cosign-refs.outputs.refs != ''
uses: LerianStudio/github-actions-shared-workflows/src/security/cosign-sign@feat/cosign-sign
uses: LerianStudio/github-actions-shared-workflows/src/security/cosign-sign@v1.23.0
with:
image-refs: ${{ steps.cosign-refs.outputs.refs }}

Expand Down
2 changes: 1 addition & 1 deletion docs/build-workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ jobs:

```bash
cosign verify \
--certificate-identity-regexp=".*" \
--certificate-identity-regexp="^https://github.com/LerianStudio/.*/.github/workflows/.*@refs/heads/.*$" \
--certificate-oidc-issuer="https://token.actions.githubusercontent.com" \
docker.io/lerianstudio/my-app@sha256:abc123...
```
Expand Down
2 changes: 1 addition & 1 deletion docs/go-release-workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ jobs:

```bash
cosign verify \
--certificate-identity-regexp=".*" \
--certificate-identity-regexp="^https://github.com/LerianStudio/.*/.github/workflows/.*@refs/heads/.*$" \
--certificate-oidc-issuer="https://token.actions.githubusercontent.com" \
ghcr.io/myorg/my-app@sha256:abc123...
```
Expand Down
3 changes: 2 additions & 1 deletion docs/typescript-build.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ on:
permissions:
contents: read
packages: write
id-token: write # required for cosign keyless signing

jobs:
build:
Expand Down Expand Up @@ -230,7 +231,7 @@ jobs:

```bash
cosign verify \
--certificate-identity-regexp=".*" \
--certificate-identity-regexp="^https://github.com/LerianStudio/.*/.github/workflows/.*@refs/heads/.*$" \
--certificate-oidc-issuer="https://token.actions.githubusercontent.com" \
ghcr.io/lerianstudio/my-app@sha256:abc123...
```
Expand Down
4 changes: 2 additions & 2 deletions src/security/cosign-sign/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
- name: Sign container image
uses: LerianStudio/github-actions-shared-workflows/src/security/cosign-sign@v1.x.x
with:
image-refs: myorg/myapp@${{ steps.build-push.outputs.digest }}
image-refs: docker.io/myorg/myapp@${{ steps.build-push.outputs.digest }}
```

### Signing multiple registries
Expand All @@ -64,7 +64,7 @@ jobs:

```bash
cosign verify \
--certificate-identity-regexp=".*" \
--certificate-identity-regexp="^https://github.com/LerianStudio/.*/.github/workflows/.*@refs/heads/.*$" \
--certificate-oidc-issuer="https://token.actions.githubusercontent.com" \
docker.io/myorg/myapp@sha256:abc123...
```
Expand Down
Loading