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
11 changes: 5 additions & 6 deletions .github/workflows/apm-materialize.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,12 @@ jobs:
permission-pull-requests: write

- name: Checkout main
# zizmor: ignore[artipacked]
# Persisted credentials are required: the open-pr step below pushes the
# materialize branch using the token checkout writes into the remote URL.
# This job runs no untrusted code — it installs the pinned apm CLI and
# runs `apm install` over the repo's own committed apm.yml.
# No persisted credentials: the open-pr step below commits through the
# GitHub API with its github-token (commit-method: api), not `git push`.
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
token: ${{ steps.app-token.outputs.token }}
persist-credentials: false

- name: Check for apm.yml
id: precheck
Expand Down Expand Up @@ -113,14 +111,15 @@ jobs:
- name: Open materialize PR
if: steps.precheck.outputs.skip != 'true'
# renovate: datasource=github-tags depName=DevSecNinja/.github
uses: DevSecNinja/.github/actions/open-pr@9c281b38f863550ddff25df04e6fda0b9b23d00c # v3.3.0
uses: DevSecNinja/.github/actions/open-pr@5cee546e22e862a82f74e8dda800d439b9af537c # v4.1.0
with:
branch: chore/apm-materialize
base: main
title: "chore: materialize APM primitives"
commit-message: "chore: materialize APM primitives from apm.yml"
labels: apm-sync
github-token: ${{ steps.app-token.outputs.token }}
commit-method: api
# Stage the lockfile and deployed harness files. apm.yml itself is
# unchanged (already on main); apm_modules/ is gitignored.
if-no-changes: skip
Expand Down
15 changes: 6 additions & 9 deletions .github/workflows/apm-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,17 +155,13 @@ jobs:
permission-pull-requests: write

- name: Checkout calling repository
# zizmor: ignore[artipacked]
# Persisted credentials are required: the `actions/open-pr` step below
# invokes `git push --force-with-lease`, which relies on the bearer
# token that `actions/checkout` writes into the remote URL. Setting
# `persist-credentials: false` here breaks PR creation without offering
# meaningful isolation — this job runs no untrusted code (it only
# installs the pinned apm CLI and runs `apm update` over the repo's own
# committed apm.yml/apm.lock.yaml).
# No persisted credentials: the `actions/open-pr` step below commits
# through the GitHub API with its github-token (commit-method: api),
# not `git push`.
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
token: ${{ steps.app-token.outputs.token || github.token }}
persist-credentials: false

- name: Check for apm.yml
id: precheck
Expand Down Expand Up @@ -202,14 +198,15 @@ jobs:
id: open-pr
if: steps.precheck.outputs.skip != 'true'
# renovate: datasource=github-tags depName=DevSecNinja/.github
uses: DevSecNinja/.github/actions/open-pr@9c281b38f863550ddff25df04e6fda0b9b23d00c # v3.3.0
uses: DevSecNinja/.github/actions/open-pr@5cee546e22e862a82f74e8dda800d439b9af537c # v4.1.0
with:
branch: ${{ inputs.pr-branch }}
base: ${{ inputs.target-branch }}
title: "chore: sync APM primitives"
commit-message: "chore: sync APM primitives from upstream packages"
labels: apm-sync
github-token: ${{ steps.app-token.outputs.token || github.token }}
commit-method: api
body: |-
Automated PR — refreshed APM primitives via `apm update`.

Expand Down
15 changes: 6 additions & 9 deletions .github/workflows/config-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,17 +142,13 @@ jobs:
permission-contents: write
permission-pull-requests: write
- name: Checkout calling repository
# zizmor: ignore[artipacked]
# Persisted credentials are required: the `actions/open-pr` step
# below invokes `git push` which relies on the bearer token that
# `actions/checkout` writes into the remote URL. Setting
# `persist-credentials: false` here breaks PR creation without
# offering meaningful isolation, since this job never executes
# content fetched from the central repo (it only reads files
# from `.config-sync-source/` to copy them).
# No persisted credentials: the `actions/open-pr` step below commits
# through the GitHub API with its github-token (commit-method: api),
# not `git push`.
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
token: ${{ steps.app-token.outputs.token || github.token }}
persist-credentials: false
- name: Checkout central config source
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
Expand Down Expand Up @@ -401,13 +397,14 @@ jobs:
fi
- name: Create PR if configs changed
if: steps.pull.outputs.updated == '1'
uses: DevSecNinja/.github/actions/open-pr@9c281b38f863550ddff25df04e6fda0b9b23d00c # v3.3.0
uses: DevSecNinja/.github/actions/open-pr@5cee546e22e862a82f74e8dda800d439b9af537c # v4.1.0
with:
branch: chore/config-sync
title: 'chore: sync config files from central repo'
commit-message: 'chore: sync config files from DevSecNinja/.github'
labels: config-sync
github-token: ${{ steps.app-token.outputs.token || github.token }}
commit-method: api
body: |-
Automated PR — config files pulled from
[DevSecNinja/.github](https://github.com/DevSecNinja/.github/tree/main/config-sync)
Expand Down
5 changes: 5 additions & 0 deletions docs/automation-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ opens a pull request:
See [ADR 0011](design-decisions/0011-single-automation-github-app.md) for the
decision.

The three PR workflows commit through the GitHub API (`open-pr` with
`commit-method: api`), so GitHub signs their commits and the PRs pass a
"require signed commits" ruleset without an admin bypass. That holds for the
`GITHUB_TOKEN` fallback too.

## Why an App instead of `GITHUB_TOKEN`

- **Pull requests and tags made with `GITHUB_TOKEN` do not trigger
Expand Down
Loading