Bumps the github-actions group with 8 updates: | Package | From | To | | --- | --- | --- | | [actions/setup-node](https://github.com/actions/setup-node) | `4` | `6` | | [github/codeql-action](https://github.com/github/codeql-action) | `3` | `4` | | [docker/metadata-action](https://github.com/docker/metadata-action) | `5` | `6` | | [sigstore/cosign-installer](https://github.com/sigstore/cosign-installer) | `3.7.0` | `4.1.2` | | [The-PR-Agent/pr-agent](https://github.com/the-pr-agent/pr-agent) | `0.38.0` | `0.39.0` | | [actions/upload-artifact](https://github.com/actions/upload-artifact) | `4.6.2` | `7.0.1` | | [actions/download-artifact](https://github.com/actions/download-artifact) | `4.3.0` | `8.0.1` | | [peter-evans/find-comment](https://github.com/peter-evans/find-comment) | `3.1.0` | `4.0.0` | Updates `actions/setup-node` from 4 to 6 - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/v4...v6) Updates `github/codeql-action` from 3 to 4 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/v3...v4) Updates `docker/metadata-action` from 5 to 6 - [Release notes](https://github.com/docker/metadata-action/releases) - [Commits](https://github.com/docker/metadata-action/compare/v5...v6) Updates `sigstore/cosign-installer` from 3.7.0 to 4.1.2 - [Release notes](https://github.com/sigstore/cosign-installer/releases) - [Commits](https://github.com/sigstore/cosign-installer/compare/v3.7.0...v4.1.2) Updates `The-PR-Agent/pr-agent` from 0.38.0 to 0.39.0 - [Release notes](https://github.com/the-pr-agent/pr-agent/releases) - [Changelog](https://github.com/The-PR-Agent/pr-agent/blob/main/CHANGELOG.md) - [Commits](https://github.com/the-pr-agent/pr-agent/compare/bd09b6cf89c6d6f3d16b159fa7603fa0e7768cf2...8e4d32e5497defd43c023a404f73560c62728961) Updates `actions/upload-artifact` from 4.6.2 to 7.0.1 - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/ea165f8d65b6e75b540449e92b4886f43607fa02...043fb46d1a93c77aae656e7c1c64a875d1fc6a0a) Updates `actions/download-artifact` from 4.3.0 to 8.0.1 - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/d3f86a106a0bac45b974a628896c90dbdf5c8093...3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c) Updates `peter-evans/find-comment` from 3.1.0 to 4.0.0 - [Release notes](https://github.com/peter-evans/find-comment/releases) - [Commits](https://github.com/peter-evans/find-comment/compare/3eae4d37986fb5a8592848f6a574fdf654e61f9e...b30e6a3c0ed37e7c023ccd3f1db5c6c0b0c23aad) --- updated-dependencies: - dependency-name: actions/setup-node dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions - dependency-name: github/codeql-action dependency-version: '4' dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions - dependency-name: docker/metadata-action dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions - dependency-name: sigstore/cosign-installer dependency-version: 4.1.2 dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions - dependency-name: The-PR-Agent/pr-agent dependency-version: 0.39.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions - dependency-name: actions/upload-artifact dependency-version: 7.0.1 dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions - dependency-name: actions/download-artifact dependency-version: 8.0.1 dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions - dependency-name: peter-evans/find-comment dependency-version: 4.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
88 lines
3.9 KiB
YAML
88 lines
3.9 KiB
YAML
name: Swedish Accounting Compliance Review
|
|
|
|
# Stage 2 of the fork-safe compliance review (stage 1 is swedish-compliance-diff.yml).
|
|
#
|
|
# SECURITY: this is the privileged half: it has the AWS Bedrock secrets and a
|
|
# write token. It is triggered by `workflow_run` (NOT pull_request_target) and
|
|
# checks out ONLY the base repo, so it never executes fork PR code. The untrusted
|
|
# input (the PR diff) arrives as a downloaded artifact and is fed to the model
|
|
# as DATA: never run. This is the pattern GitHub recommends instead of
|
|
# `pull_request_target` + checking out the PR head.
|
|
|
|
on:
|
|
workflow_run:
|
|
# Must match the `name:` field in swedish-compliance-diff.yml exactly.
|
|
# A rename there silently stops this trigger from firing on all subsequent PRs.
|
|
workflows: ["Compliance diff"]
|
|
types: [completed]
|
|
|
|
permissions:
|
|
contents: read
|
|
actions: read # required to download the artifact from the triggering run
|
|
pull-requests: write # required to post the review comment
|
|
|
|
jobs:
|
|
review:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
# Only act on PR-triggered diffs that actually produced an artifact.
|
|
if: >
|
|
github.event.workflow_run.event == 'pull_request' &&
|
|
github.event.workflow_run.conclusion == 'success'
|
|
steps:
|
|
# Base repo only: the TRUSTED copy of the script and .claude/skills/.
|
|
# persist-credentials: false, no later step needs git push creds, so don't
|
|
# leave the token in .git/config for the steps that handle untrusted input.
|
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
|
|
with:
|
|
persist-credentials: false
|
|
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
|
with:
|
|
node-version: 20
|
|
- name: Download diff artifact
|
|
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
|
with:
|
|
name: compliance-input
|
|
run-id: ${{ github.event.workflow_run.id }}
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: Resolve PR number
|
|
id: pr
|
|
run: |
|
|
set -euo pipefail
|
|
NUM=$(cat pr-number.txt)
|
|
# Guard: pr-number.txt must be a plain integer (artifact is untrusted input).
|
|
if ! [[ "$NUM" =~ ^[0-9]+$ ]]; then
|
|
echo "Refusing to continue: pr-number.txt is not a number" >&2
|
|
exit 1
|
|
fi
|
|
echo "number=$NUM" >> "$GITHUB_OUTPUT"
|
|
- name: Install Anthropic Bedrock SDK
|
|
# Pinned exact version + --ignore-scripts: this is the privileged job
|
|
# (write token in env), so no floating @latest and no dependency
|
|
# lifecycle scripts may execute here.
|
|
run: npm install --no-save --no-package-lock --ignore-scripts @anthropic-ai/bedrock-sdk@0.31.0
|
|
- name: Run compliance review
|
|
env:
|
|
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
AWS_REGION: ${{ secrets.AWS_REGION || 'eu-north-1' }}
|
|
REVIEW_MODEL: eu.anthropic.claude-sonnet-4-6
|
|
# Two-stage mode: read the diff from the artifact instead of git-diffing.
|
|
DIFF_FILE: diff.patch
|
|
FILES_FILE: files.txt
|
|
run: node scripts/swedish-compliance-review.mjs
|
|
- name: Find previous compliance comment
|
|
uses: peter-evans/find-comment@b30e6a3c0ed37e7c023ccd3f1db5c6c0b0c23aad # v4.0.0
|
|
id: find-comment
|
|
with:
|
|
issue-number: ${{ steps.pr.outputs.number }}
|
|
comment-author: 'github-actions[bot]'
|
|
body-includes: '<!-- swedish-compliance-review-bot -->'
|
|
- name: Post or update PR comment
|
|
uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5
|
|
with:
|
|
issue-number: ${{ steps.pr.outputs.number }}
|
|
comment-id: ${{ steps.find-comment.outputs.comment-id }}
|
|
body-path: review.md
|
|
edit-mode: replace
|