-
Notifications
You must be signed in to change notification settings - Fork 15
57 lines (55 loc) · 2.02 KB
/
Copy pathupdate-cfbs-manual.yml
File metadata and controls
57 lines (55 loc) · 2.02 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
name: Update cfbs manual
on:
push:
branches:
- master
workflow_call:
workflow_dispatch: # Enables manual trigger
jobs:
update_cfbs_manual:
name: Update cfbs manual
runs-on: ubuntu-24.04
permissions:
contents: write
pull-requests: write
steps:
- name: Checks-out repository
uses: actions/checkout@v4
with:
ref: "master"
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install argparse-manpage setuptools
- name: Set Git user
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
- name: Save manpage hash before
# ignore the first line as it contains the date and we don't want to update the manual if this is the only difference
run: |
echo "MANPAGE_HASH_BEFORE=$(tail -n +2 cfbs/cfbs.1 | sha256sum)">> $GITHUB_ENV
- name: Run manual generator
run: export PYTHONPATH=. && python3 cfbs/man_generator.py
- name: Save manpage hash after
run: |
echo "MANPAGE_HASH_AFTER=$(tail -n +2 cfbs/cfbs.1 | sha256sum)">> $GITHUB_ENV
- name: Create Git commit
if: env.MANPAGE_HASH_BEFORE != env.MANPAGE_HASH_AFTER
run: git add cfbs/cfbs.1 && git commit -m "Regenerated man page"
- name: Create Pull Request
if: env.MANPAGE_HASH_BEFORE != env.MANPAGE_HASH_AFTER
uses: cfengine/create-pull-request@v6
with:
title: Updated cfbs manual
body: Automated updates to the cfbs manual using [the `update_cfbs_manual` workflow](https://github.com/cfengine/cfbs/blob/master/.github/workflows/update-cfbs-manual.yml).
reviewers: |
olehermanse
larsewi
craigcomstock
branch: pr-update-manpage
branch-suffix: timestamp