diff --git a/.github/workflows/actions.lock b/.github/workflows/actions.lock index 28b7b1e..4b58448 100644 --- a/.github/workflows/actions.lock +++ b/.github/workflows/actions.lock @@ -3,26 +3,6 @@ # Docs: https://gh.io/actions-lockfile version: 'v0.0.3' workflows: - '.github/workflows/housekeeping.yml': - - 'actions/checkout@v6.0.2' - - 'hashintel/actions@main' - '.github/workflows/preflight-target.yml': [] + '.github/workflows/housekeeping.yml': [] + '.github/workflows/preflight-edit.yml': [] '.github/workflows/preflight.yml': [] -dependencies: - 'actions/checkout@v6.0.2': - ref: 'v6.0.2' - commit: 'sha1-de0fac2e4500dabe0009e67214ff5f5447ce83dd' - owner_id: 44036562 - repo_id: 197814629 - 'actions/setup-node@v7.1.0': - ref: 'v7.1.0' - commit: 'sha1-949feb2413d6458794dcd2491c4babbbce0c15c1' - owner_id: 44036562 - repo_id: 189476904 - 'hashintel/actions@main': - ref: 'main' - commit: 'sha1-06238755f2364521d75a1eaf0b3b397261f46077' - owner_id: 22116112 - repo_id: 1389230708 - uses: - - 'actions/setup-node@v7.1.0' diff --git a/.github/workflows/housekeeping.yml b/.github/workflows/housekeeping.yml index 8b72a7c..f20cd50 100644 --- a/.github/workflows/housekeeping.yml +++ b/.github/workflows/housekeeping.yml @@ -1,10 +1,6 @@ name: Housekeeping on: - pull_request: - paths: - - ".github/workflows/housekeeping.yml" - - ".github/renovate.json" schedule: - cron: "0 3 * * *" workflow_dispatch: @@ -40,38 +36,33 @@ on: - lookup - full +# A new run waits for the running one instead of cancelling it, so a Renovate +# run on `main` always finishes. +concurrency: + group: ${{ github.workflow }}-caller + cancel-in-progress: false + permissions: {} jobs: - validate: - name: Validate - if: github.event_name == 'pull_request' - runs-on: ubuntu-26.04 - permissions: - contents: read - steps: - - name: Checkout - uses: actions/checkout@v6.0.2 - - - name: Install Renovate - uses: hashintel/actions/.github/actions/install-renovate@main - - - name: Validate Renovate config - run: renovate-config-validator --strict - renovate: name: Dependencies - if: github.event_name != 'pull_request' permissions: - actions: read + actions: read # Renovate downloads its repository cache artifact contents: read - id-token: write - uses: hashintel/actions/.github/workflows/housekeeping-dependencies.yml@06238755f2364521d75a1eaf0b3b397261f46077 # main + id-token: write # Vault JWT login that mints the Renovate installation token + uses: hashintel/actions/.github/workflows/housekeeping-dependencies.yml@13a244f21ce0aed2840fbd16b8cbe934521d3c43 # main with: + vault-role: ci-hashintel-blocks-renovate + environment: Renovate repoCache: ${{ inputs.repoCache || 'enabled' }} logLevel: ${{ inputs.logLevel || 'info' }} overrideSchedule: ${{ inputs.overrideSchedule || false }} dryRun: ${{ inputs.dryRun || 'disabled' }} secrets: - CF_ACCESS_STAGE_CLIENT_SECRET: ${{ secrets.CF_ACCESS_STAGE_CLIENT_SECRET }} + # Only in the `Renovate` environment of the called jobs; a called workflow gets only the secrets its caller names. + # jactionlint ignore=secrets-outside-env + CF_ACCESS_CLIENT_SECRET: ${{ secrets.CF_ACCESS_CLIENT_SECRET }} + # Only in the `Renovate` environment of the called jobs; a called workflow gets only the secrets its caller names. + # jactionlint ignore=secrets-outside-env RENOVATE_TOKEN_ENC_KEY: ${{ secrets.RENOVATE_TOKEN_ENC_KEY }} diff --git a/.github/workflows/preflight-edit.yml b/.github/workflows/preflight-edit.yml new file mode 100644 index 0000000..bcb9155 --- /dev/null +++ b/.github/workflows/preflight-edit.yml @@ -0,0 +1,28 @@ +name: Preflight + +on: + pull_request: + # `edited` matters: the todo-comments scan and the PR title check read the PR title. + types: [opened, synchronize, reopened, edited] + merge_group: + +# A called workflow reads the caller's `github.workflow`, so its group is `Preflight-preflight--…`. +# This group must match neither those nor the group of `preflight.yml`, which has the same name. +concurrency: + group: preflight-edit-caller-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +permissions: {} + +jobs: + todo-comments: + name: Todo comments + permissions: + contents: read + uses: hashintel/actions/.github/workflows/preflight-todo-comments.yml@13a244f21ce0aed2840fbd16b8cbe934521d3c43 # main + + pr-title: + name: PR title + permissions: + contents: read + uses: hashintel/actions/.github/workflows/preflight-pr-title.yml@13a244f21ce0aed2840fbd16b8cbe934521d3c43 # main diff --git a/.github/workflows/preflight-target.yml b/.github/workflows/preflight-target.yml deleted file mode 100644 index f8574ac..0000000 --- a/.github/workflows/preflight-target.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Preflight - -on: - pull_request: - paths: - - ".github/workflows/preflight-target.yml" - pull_request_target: - types: [opened, synchronize, reopened, edited] - merge_group: - -permissions: {} - -jobs: - dependencies: - name: Dependencies - permissions: - contents: read - pull-requests: write - uses: hashintel/actions/.github/workflows/preflight-dependencies.yml@06238755f2364521d75a1eaf0b3b397261f46077 # main - - pr-title: - name: PR title - permissions: - contents: read - uses: hashintel/actions/.github/workflows/preflight-pr-title.yml@06238755f2364521d75a1eaf0b3b397261f46077 # main diff --git a/.github/workflows/preflight.yml b/.github/workflows/preflight.yml index c3a0221..b788d1b 100644 --- a/.github/workflows/preflight.yml +++ b/.github/workflows/preflight.yml @@ -2,21 +2,26 @@ name: Preflight on: pull_request: - # `edited` matters: the todo-comments scan derives its ticket IDs from the PR title. - types: [opened, synchronize, reopened, edited] merge_group: +# A called workflow reads the caller's `github.workflow`, so its group is `Preflight-preflight--…`. +# This group must match neither those nor the group of `preflight-edit.yml`, which has the same name. +concurrency: + group: preflight-caller-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + permissions: {} jobs: - todo-comments: - name: Todo comments + lint: + name: Lint permissions: contents: read - uses: hashintel/actions/.github/workflows/preflight-todo-comments.yml@06238755f2364521d75a1eaf0b3b397261f46077 # main + uses: hashintel/actions/.github/workflows/preflight-lint.yml@13a244f21ce0aed2840fbd16b8cbe934521d3c43 # main - lint: - name: Lint + dependencies: + name: Dependencies permissions: contents: read - uses: hashintel/actions/.github/workflows/preflight-lint.yml@06238755f2364521d75a1eaf0b3b397261f46077 # main + pull-requests: write # Dependency review comments its summary on the PR + uses: hashintel/actions/.github/workflows/preflight-dependencies.yml@13a244f21ce0aed2840fbd16b8cbe934521d3c43 # main diff --git a/README.md b/README.md index 894a3cf..2b6a14d 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ These requirements already existed in Labs. Once the shared tooling is available ## Repository setup -The repository uses HASH's shared PR checks and Renovate workflow. Scheduled dependency updates require access to the `VAULT_STAGE_ADDR` and `CF_ACCESS_STAGE_CLIENT_ID` organization variables, plus the `CF_ACCESS_STAGE_CLIENT_SECRET` and `RENOVATE_TOKEN_ENC_KEY` organization secrets. Pull requests validate the workflow and configuration without starting dependency updates. +The repository uses HASH's shared PR checks and Renovate workflow. Scheduled dependency updates read `VAULT_ADDR`, `CF_ACCESS_CLIENT_ID`, `CF_ACCESS_CLIENT_SECRET` and `RENOVATE_TOKEN_ENC_KEY` from the repository's `Renovate` environment, which only `main` may use. Preflight Lint validates the workflows and the Renovate configuration. Block publishing workflows must also be configured before publishing from this repository.