Repository navigation
112 lines (103 loc) · 4.71 KB
/
Copy pathdigests.yml
File metadata and controls
112 lines (103 loc) · 4.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
---
name: Digest drift
# A pinned digest is a claim about what the registry holds, and it goes stale on
# the registry's schedule rather than on ours — so unlike the other four jobs in
# #77 this one has nothing to do with the monitoring host. It needs no secret,
# no docker daemon and no lab access: scripts/pin-digests.sh resolves each image
# through the registry HTTP API with curl and python3.
#
# That makes CI the right home for it and a systemd timer the wrong one. It also
# means this is the one scheduled check in the estate that is genuinely off-host,
# which matters given that everything else in #77 runs on the machine it is
# checking.
#
# A SEPARATE WORKFLOW, NOT A schedule: ON ci.yml
#
# Two reasons. ci.yml sets `concurrency: cancel-in-progress: true` keyed on
# workflow and ref, so a scheduled run on main would race with pushes to main
# and one would cancel the other. And a schedule there would drag the whole
# lint/validate/secret-scan matrix along every week to answer one question.
#
# Note that GitHub disables scheduled workflows after 60 days with no repository
# activity, and does so silently. If this stops reporting, check that first:
#
# gh workflow view digests.yml # "disabled_inactivity" means exactly this
# gh workflow enable digests.yml
#
# No keepalive job, deliberately (#839): this repository commits most days, and
# a job that commits only to stay scheduled is noise in the history it exists
# to protect.
on:
schedule:
# Mondays, early. Dependabot opens its compose PRs on Sundays, so this runs
# after them: drift that Dependabot has already fixed should not be reported
# as drift.
- cron: "0 7 * * 1"
workflow_dispatch:
permissions:
contents: read
# Queued, not cancelled. A weekly check that a manual re-run kills halfway has
# answered nothing; the second run waits for the first instead (#839).
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false
jobs:
digests:
name: Pinned digests still match the registry
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
# Exits non-zero on drift, which is the point — the run failing IS the
# notification. It also exits non-zero on a hard error such as the
# registry being unreachable, and the two are not distinguishable from the
# exit status alone. Acceptable here, because both are things a human
# should look at; it would not be acceptable on a host timer, where a
# registry outage would read as drift and alert.
#
# `make check-digests`, not pin-digests.sh directly. The script reads one
# compose file and defaults to stacks/observability, so until this called
# the Makefile loop over scripts/stacks.sh the weekly check covered that
# one stack, and drift in scratch, sensitive, soc and wiki went
# unreported.
# The target checks every stack before it fails and names the ones that
# drifted.
- name: Check digests
run: make check-digests
# The pins Dependabot has no ecosystem for: the Packer plugin, the
# ansible-galaxy collections (#848), and the Alpine and Gentoo cloud images
# scripts/import-cloud-template.sh imports (ADR-0090). Each stays an exact pin and a deliberate
# edit; this only says when upstream has a newer release, which until now
# nothing did. Same contract as the digests job: the failing run is the
# notification. The token only lifts the GitHub API's anonymous rate limit.
tools:
name: Pinned tool versions are current
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Check the Packer plugin, Galaxy collection and cloud image pins
env:
GITHUB_TOKEN: ${{ github.token }}
run: ./scripts/check_tool_versions.py
# The ruleset on main is the gate converge.sh relies on, and it lives in a
# settings page that no diff shows (#833). Weekly, and here rather than on
# pull requests: a PR that changes .github/rulesets/main.json is ahead of the
# live ruleset until someone applies it, and failing that PR for it would be
# a check that can only pass after its own merge.
ruleset:
name: The ruleset on main matches .github/rulesets/main.json
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Check the ruleset
env:
GITHUB_TOKEN: ${{ github.token }}
run: ./scripts/check-ruleset.sh