-
Notifications
You must be signed in to change notification settings - Fork 1
52 lines (43 loc) · 1.44 KB
/
update-from-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
name: Update From Changelog
on:
workflow_run:
workflows: ["Update From Submodule"]
types:
- completed
permissions:
contents: write
jobs:
update_changelog:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
# Check out the branch from the triggering workflow
ref: ${{ github.event.workflow_run.head_branch }}
submodules: true
- name: Validate repository
run: |
if [[ ${{ github.event.workflow_run.head_repository.full_name }} != "${{ github.repository }}" ]]; then
echo "Untrusted repository detected! Exiting."
exit 1
fi
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
fingerprint: "F768450FB05B817D0B4BC26FB9B6A9B428C8676A"
trust_level: 5
- name: Run update script
run: bash update-changelog.bash
- name: Show updated 'CHANGELOG.md'
run: cat CHANGELOG.md
- name: Commit and push changes
run: |
git add .
git commit -m "Update 'CHANGELOG.md' based on submodule commits"
git pull --rebase origin ${{ github.ref_name }}
git push origin HEAD:${{ github.ref_name }}