-
Notifications
You must be signed in to change notification settings - Fork 119
55 lines (53 loc) · 2.16 KB
/
changelog.yml
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
name: Changelog
on:
repository_dispatch:
types: update-changelog
jobs:
update-changelog:
name: Update Changelog
# This job fetches the `CHANGELOG.md` from the corresponding branch in the
# mixxxdj/mixxx repository and uses it to update the `changelog.rst`
# file. If the file was changed, the change is committed and a
# rebuild/redeployment of the manual is triggered.
#
# This job is not run on changes to the manual repo. Instead, it's
# triggered by a repository dispatch hook that gets triggered by a
# corresponding workflow in the mixxxdj/mixxx repository whenever the
# CHANGELOG.md is changed.
runs-on: ubuntu-latest
steps:
- name: Event Information
run: echo "Event '${{ github.event.action }}' received from '${{ github.event.client_payload.repository }}'"
- name: Check out repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.client_payload.branch }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Install Python dependencies
run: pip install -r requirements-changelog.txt
- name: Update Changelog
run: tools/update_changelog.py -b "${{ github.event.client_payload.branch }}"
- name: Check if changes any changes were made
run: echo "GIT_DIRTY=$(git diff --quiet ; printf "%d" "$?")" >> "${GITHUB_ENV}"
- uses: EndBug/add-and-commit@v9
if: env.GIT_DIRTY != null && env.GIT_DIRTY != '0'
with:
branch: ${{ github.event.client_payload.branch }}
add: "source/chapters/appendix/changelog.rst"
message: "appendix/changelog: Update changelog for ${{ github.event.client_payload.branch }} branch"
author_name: mixxxbot
author_email: [email protected]
push: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Trigger Rebuild
uses: peter-evans/repository-dispatch@v3
if: env.GIT_DIRTY != null && env.GIT_DIRTY != '0' && env.MIXXXBOT_TOKEN != null
with:
token: ${{ env.MIXXXBOT_TOKEN }}
event-type: rebuild
env:
MIXXXBOT_TOKEN: ${{ secrets.MIXXXBOT_CHANGELOG_AUTOUPDATER_PAT }}