-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgithub-actions.yml
More file actions
49 lines (47 loc) · 1.67 KB
/
Copy pathgithub-actions.yml
File metadata and controls
49 lines (47 loc) · 1.67 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
# doctier on GitHub Actions.
#
# Copy to .github/workflows/doctier.yml in your repo. Two jobs:
# check — fail-closed policy check on every pull request (the only
# host-independent guarantee; runs on the committed blobs, no age key
# needed since it never decrypts).
# gc — collect pr-merge ephemerals after a merge lands on the default
# branch, then commit the deletions back.
#
# Both use the bundled action (RubenGlez/doctier/action), which installs the
# prebuilt binary checksum-verified and leaves `doctier` on PATH for later
# steps. Pin @main to a tag once you depend on this in earnest.
name: doctier
on:
pull_request:
push:
branches: [main]
jobs:
check:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: RubenGlez/doctier/action@main # runs `doctier check` by default
gc:
if: github.event_name == 'push'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
# Check out the branch itself (not a detached HEAD): pr-merge collection
# only runs when HEAD is the integration branch.
- uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
fetch-depth: 0
- uses: RubenGlez/doctier/action@main
with:
args: gc --trigger pr-merge
- name: Commit collected ephemerals
run: |
if ! git diff --cached --quiet; then
git config user.name "doctier-bot"
git config user.email "doctier@users.noreply.github.com"
git commit -m "chore(doctier): collect pr-merge ephemerals [skip ci]"
git push
fi