Files
hermes-agent/.github/workflows/archive-inputs.yml

50 lines
1.8 KiB
YAML

name: Archive pinned PM inputs
on:
push:
branches: [main]
paths:
- 'pm/lock.json'
- 'pm/artifact-mirror.json'
- 'scripts/termux/runtime_libs.json'
- 'scripts/ci/archive_inputs.py'
- '.github/workflows/archive-inputs.yml'
workflow_call:
inputs:
sha:
description: 'The admitted commit whose pins are archived.'
required: true
type: string
workflow_dispatch:
permissions:
contents: read
jobs:
archive-inputs:
name: Preserve every pinned HTTP input
if: github.event_name != 'pull_request' && github.event_name != 'pull_request_target'
runs-on: ubuntu-24.04
environment: release-signing
timeout-minutes: 60
env:
CLOUDFLARE_R2_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_R2_ACCOUNT_ID }}
CLOUDFLARE_R2_ACCESS_KEY_ID: ${{ secrets.CLOUDFLARE_R2_ACCESS_KEY_ID }}
CLOUDFLARE_R2_SECRET_ACCESS_KEY: ${{ secrets.CLOUDFLARE_R2_SECRET_ACCESS_KEY }}
CLOUDFLARE_R2_BUCKET: ${{ vars.CLOUDFLARE_R2_BUCKET }}
steps:
- uses: actions/checkout@f548e57e544e1ff5a4c46bf1e1b8685f8e4a348a # v7.0.1
with:
ref: ${{ inputs.sha || github.sha }}
persist-credentials: false
# Runner Python is intentional: the toolchain's upstream may be gone.
# A job-level `if` cannot read `secrets`; the job env can. Forks and a
# repo whose release-signing environment is not provisioned yet must
# skip the archive, not turn main red.
- name: Verify and archive every pinned input
if: env.CLOUDFLARE_R2_ACCOUNT_ID != ''
run: python3 -m scripts.ci.archive_inputs
- name: Report the unprovisioned archive
if: env.CLOUDFLARE_R2_ACCOUNT_ID == ''
run: echo "::notice::CLOUDFLARE_R2_* secrets are not configured; pinned inputs were not archived."