diff --git a/.github/workflows/autodoc-executor.yml b/.github/workflows/autodoc-executor.yml index 6c81bca..951fffb 100644 --- a/.github/workflows/autodoc-executor.yml +++ b/.github/workflows/autodoc-executor.yml @@ -70,10 +70,10 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.2.2 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - https://github.com/actions/checkout/releases/tag/v7.0.1 - name: Configure AWS credentials (OIDC) - uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4 + uses: aws-actions/configure-aws-credentials@e6de054238d6b7531b4efff3b6587d9aade6a06c # v6.2.3 - https://github.com/aws-actions/configure-aws-credentials/releases/tag/v6.2.3 with: role-to-assume: ${{ inputs.bedrock_role_arn }} aws-region: ${{ inputs.aws_region }} @@ -90,7 +90,7 @@ jobs: echo "value=$ARGS" >> "$GITHUB_OUTPUT" - name: Run Claude (Bedrock) - uses: anthropics/claude-code-action@be7b93b1907a4abad570368f3c74b6fe3807510b # v1 + uses: anthropics/claude-code-action@be7b93b1907a4abad570368f3c74b6fe3807510b # v1.0.183 - https://github.com/anthropics/claude-code-action/releases/tag/v1.0.183 env: AUTODOC_DOTCMS_API_TOKEN_AISEARCH: ${{ secrets.AUTODOC_DOTCMS_API_TOKEN_AISEARCH }} AUTODOC_DOTCMS_API_TOKEN_DRAFTING: ${{ secrets.AUTODOC_DOTCMS_API_TOKEN_DRAFTING }} @@ -105,7 +105,7 @@ jobs: - name: Upload report artifact if: always() - uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.6.0 + uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.6.0 - https://github.com/actions/upload-artifact/releases/tag/v4.6.0 with: name: autodoc-report path: /tmp/autodoc-report.md diff --git a/.github/workflows/bedrock-generic-executor.yml b/.github/workflows/bedrock-generic-executor.yml index a898c32..ca52cce 100644 --- a/.github/workflows/bedrock-generic-executor.yml +++ b/.github/workflows/bedrock-generic-executor.yml @@ -96,12 +96,12 @@ jobs: # trailing " -->" keeps the sticky marker from being a prefix of the SHA form. STICKY_MARKER: ${{ inputs.use_sticky_comment == false && format('', inputs.sticky_namespace != '' && inputs.sticky_namespace || inputs.model_id, github.event.pull_request.head.sha || github.sha) || format('', inputs.sticky_namespace != '' && inputs.sticky_namespace || inputs.model_id) }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - https://github.com/actions/checkout/releases/tag/v7.0.1 with: fetch-depth: 1 - name: Configure AWS credentials (OIDC) - uses: aws-actions/configure-aws-credentials@v4 + uses: aws-actions/configure-aws-credentials@e6de054238d6b7531b4efff3b6587d9aade6a06c # v6.2.3 - https://github.com/aws-actions/configure-aws-credentials/releases/tag/v6.2.3 with: role-to-assume: ${{ inputs.bedrock_role_arn }} aws-region: ${{ inputs.aws_region }} diff --git a/.github/workflows/bedrock-harness-executor.yml b/.github/workflows/bedrock-harness-executor.yml index 7256e28..fcba74a 100644 --- a/.github/workflows/bedrock-harness-executor.yml +++ b/.github/workflows/bedrock-harness-executor.yml @@ -150,20 +150,20 @@ jobs: # the sticky marker from being a prefix of the SHA form. STICKY_MARKER: ${{ inputs.use_sticky_comment == false && format('', inputs.sticky_namespace != '' && inputs.sticky_namespace || inputs.model_id, github.event.pull_request.head.sha || github.sha) || format('', inputs.sticky_namespace != '' && inputs.sticky_namespace || inputs.model_id) }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - https://github.com/actions/checkout/releases/tag/v7.0.1 with: # Full working tree of the PR (merge ref) so the harness can grep/read any file, # not just the diff. fetch-depth:1 is enough — we read current state, not history. fetch-depth: 1 - name: Configure AWS credentials (OIDC) - uses: aws-actions/configure-aws-credentials@v4 + uses: aws-actions/configure-aws-credentials@e6de054238d6b7531b4efff3b6587d9aade6a06c # v6.2.3 - https://github.com/aws-actions/configure-aws-credentials/releases/tag/v6.2.3 with: role-to-assume: ${{ inputs.bedrock_role_arn }} aws-region: ${{ inputs.aws_region }} - name: Set up uv - uses: astral-sh/setup-uv@v6 + uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 - https://github.com/astral-sh/setup-uv/releases/tag/v10.0.1 with: enable-cache: true diff --git a/.github/workflows/claude-executor.yml b/.github/workflows/claude-executor.yml index f746b43..b3121b3 100644 --- a/.github/workflows/claude-executor.yml +++ b/.github/workflows/claude-executor.yml @@ -117,13 +117,13 @@ jobs: esac - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - https://github.com/actions/checkout/releases/tag/v7.0.1 with: fetch-depth: 1 - name: Configure AWS credentials (OIDC) if: inputs.provider == 'anthropic-bedrock' - uses: aws-actions/configure-aws-credentials@v4 + uses: aws-actions/configure-aws-credentials@e6de054238d6b7531b4efff3b6587d9aade6a06c # v6.2.3 - https://github.com/aws-actions/configure-aws-credentials/releases/tag/v6.2.3 with: role-to-assume: ${{ inputs.bedrock_role_arn }} aws-region: ${{ inputs.aws_region }} @@ -190,7 +190,7 @@ jobs: id: claude-api if: inputs.provider == 'anthropic-api' && steps.api-check.outputs.available == 'true' continue-on-error: true - uses: anthropics/claude-code-action@v1 + uses: anthropics/claude-code-action@a60f3e1db3edbceed2b1e6c6a9d34c36b8a15eba # v1.0.209 - https://github.com/anthropics/claude-code-action/releases/tag/v1.0.209 with: anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} prompt: ${{ inputs.prompt }} @@ -202,7 +202,7 @@ jobs: id: claude-bedrock if: inputs.provider == 'anthropic-bedrock' continue-on-error: true - uses: anthropics/claude-code-action@v1 + uses: anthropics/claude-code-action@a60f3e1db3edbceed2b1e6c6a9d34c36b8a15eba # v1.0.209 - https://github.com/anthropics/claude-code-action/releases/tag/v1.0.209 with: use_bedrock: "true" prompt: ${{ inputs.prompt }} diff --git a/.github/workflows/codex-executor.yml b/.github/workflows/codex-executor.yml index 7bfca13..927cc55 100644 --- a/.github/workflows/codex-executor.yml +++ b/.github/workflows/codex-executor.yml @@ -152,18 +152,18 @@ jobs: # trailing " -->" keeps the sticky marker from being a prefix of the SHA form. STICKY_MARKER: ${{ inputs.use_sticky_comment == false && format('', inputs.sticky_namespace != '' && inputs.sticky_namespace || inputs.model_id, github.event.pull_request.head.sha || github.sha) || format('', inputs.sticky_namespace != '' && inputs.sticky_namespace || inputs.model_id) }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - https://github.com/actions/checkout/releases/tag/v7.0.1 with: fetch-depth: 1 - name: Configure AWS credentials (OIDC) - uses: aws-actions/configure-aws-credentials@v4 + uses: aws-actions/configure-aws-credentials@e6de054238d6b7531b4efff3b6587d9aade6a06c # v6.2.3 - https://github.com/aws-actions/configure-aws-credentials/releases/tag/v6.2.3 with: role-to-assume: ${{ inputs.bedrock_role_arn }} aws-region: ${{ inputs.aws_region }} - name: Set up uv - uses: astral-sh/setup-uv@v6 + uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 - https://github.com/astral-sh/setup-uv/releases/tag/v10.0.1 with: enable-cache: true diff --git a/.github/workflows/deployment-guard.yml b/.github/workflows/deployment-guard.yml index 3ab05e3..0dab6c2 100644 --- a/.github/workflows/deployment-guard.yml +++ b/.github/workflows/deployment-guard.yml @@ -75,7 +75,7 @@ jobs: steps: - name: Check if PR author is organization member id: check - uses: actions/github-script@v7 + uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0 - https://github.com/actions/github-script/releases/tag/v7.1.0 with: script: | const trustedOrg = '${{ inputs.trusted_organization }}'; @@ -176,7 +176,7 @@ jobs: changed-files: ${{ steps.get-files.outputs.files }} steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - https://github.com/actions/checkout/releases/tag/v7.0.1 with: fetch-depth: 0 @@ -266,7 +266,7 @@ jobs: old-images: ${{ steps.check-changes.outputs.old-images }} steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - https://github.com/actions/checkout/releases/tag/v7.0.1 with: fetch-depth: 0 @@ -745,7 +745,7 @@ jobs: - name: Create PR comment if: github.event_name == 'pull_request' - uses: actions/github-script@v7 + uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7.1.0 - https://github.com/actions/github-script/releases/tag/v7.1.0 with: script: | const shouldBypass = '${{ needs.check-org-membership.outputs.should-bypass }}' === 'true'; diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 894f244..c81192a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,7 +14,7 @@ jobs: contents: read steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - https://github.com/actions/checkout/releases/tag/v7.0.1 - name: Lint workflows with actionlint (docker) run: | docker run --rm -v "${PWD}:/repo" -w /repo rhysd/actionlint:1.7.7 @@ -24,7 +24,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - https://github.com/actions/checkout/releases/tag/v7.0.1 - name: Validate GitHub Actions workflows run: | diff --git a/CLAUDE.md b/CLAUDE.md index 82d1f51..80a88e4 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -173,6 +173,46 @@ uses: dotCMS/ai-workflows/.github/workflows/claude-orchestrator.yml@v1.0.0 uses: dotCMS/ai-workflows/.github/workflows/claude-orchestrator.yml@main ``` +### External Action Pinning (third-party `uses:` steps) + +Every third-party action referenced inside this repo's own workflow files (`actions/checkout`, +`aws-actions/configure-aws-credentials`, `astral-sh/setup-uv`, `anthropics/claude-code-action`, +`actions/github-script`, `actions/upload-artifact`, etc.) **must be pinned to a full 40-character +commit SHA, never a tag or branch**. Semgrep's `github-actions-mutable-action-tag` rule enforces +this in CI. Tags are mutable — the action owner (or an attacker who compromises their account) can +silently repoint one, as happened in the `tegioz/repo-lockdown`, `tj-actions/changed-files`, and +`reviewdog/action-setup` supply-chain incidents. A SHA is the one reference GitHub cannot let +anyone quietly move. + +Required format — SHA, then a comment with the resolved version and a link to that version's +release page: + +```yaml +uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - https://github.com/actions/checkout/releases/tag/v7.0.1 +``` + +**How to resolve a tag to a SHA** (don't hand-copy the SHA shown in the GitHub UI for a moving +major like `@v7` — resolve the exact patch tag you intend to pin): + +```bash +gh api repos///git/refs/tags/ --jq '.object.sha, .object.type' +# if .object.type is "tag" (annotated), dereference once more: +gh api repos///git/tags/ --jq '.object.sha' +# confirm which version tag(s) actually point at that commit: +gh api repos///tags --paginate --jq '.[] | select(.commit.sha=="") | .name' +``` + +**GitHub tag behavior to know:** +- A bare major (`v7`, `v6`, `v10`) is a convenience ref some action authors move to track their + latest matching patch release — it is not guaranteed to exist. `astral-sh/setup-uv@v10` was + found dead (only `v10.0.0`/`v10.0.1` tags exist upstream, no `v10`) despite being referenced + live in this repo — always verify the tag resolves before trusting it (`git ls-remote --tags + --heads ` returns nothing if it doesn't). +- Annotated tags need one extra API hop to reach the commit SHA (`git/refs/tags` returns a tag + object, not a commit, until dereferenced) — lightweight tags resolve directly. +- When bumping a pinned SHA later, re-verify with the commands above rather than trusting a stale + comment; the version-in-comment is documentation, not a source of truth. + ## Usage by Consuming Repositories Consumer repositories handle their own webhook triggers and conditional logic, then call centralized workflows. This preserves event context and prevents double triggering.