Skip to content

Commit 9d71280

Browse files
chore: use pull request based approach for changelog updates (#12497)
1 parent 91ea600 commit 9d71280

File tree

1 file changed

+23
-20
lines changed

1 file changed

+23
-20
lines changed

.github/workflows/changelog.yml

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@ on:
66
branches: [ master ]
77
tags: [ "*" ]
88

9+
permissions: {}
10+
911
jobs:
1012
changelog:
1113
runs-on: ubuntu-latest
12-
permissions:
13-
contents: write
14-
pull-requests: read
14+
permissions: {}
1515

1616
steps:
1717
- name: Checkout
1818
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1919
with:
20-
ssh-key: ${{ secrets.DEPLOYMENT_SSH_KEY }}
2120
fetch-depth: 0
21+
persist-credentials: false
2222

2323
- name: Generate changelog
2424
uses: actionhippie/calens@244f3e5c328b842a740113859b87bbebf697f63b # v1.13.1
@@ -31,19 +31,22 @@ jobs:
3131
- name: Output
3232
run: cat CHANGELOG.md
3333

34-
- name: Publish
35-
if: >
36-
github.event_name == 'push' &&
37-
github.ref == 'refs/heads/master' &&
38-
!startsWith(github.ref, 'refs/tags/') &&
39-
!startsWith(github.ref, 'refs/pull/')
40-
run: |
41-
git config user.name "ownClouders"
42-
git config user.email "devops@owncloud.com"
43-
git add CHANGELOG.md
44-
if git diff --staged --quiet; then
45-
echo "No changes to commit"
46-
exit 0
47-
fi
48-
git commit -m "Automated changelog update [skip ci]"
49-
git push origin master
34+
- name: Generate GitHub App token
35+
id: app-token
36+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
37+
uses: actions/create-github-app-token@21cfef2b496dd8ef5b904c159339626a10ad380e # v1.11.6
38+
with:
39+
app-id: ${{ secrets.TRANSLATION_APP_ID }}
40+
private-key: ${{ secrets.TRANSLATION_APP_PRIVATE_KEY }}
41+
42+
- name: Create or update changelog pull request
43+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
44+
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0
45+
with:
46+
token: ${{ steps.app-token.outputs.token }}
47+
branch: chore/changelog-update
48+
commit-message: "chore: update changelog"
49+
title: "chore: update changelog"
50+
body: "Automated changelog update. This pull request is updated on each push to master — merging it will close it and a fresh one will be opened on the next change."
51+
delete-branch: true
52+
sign-commits: true

0 commit comments

Comments
 (0)