Debian Codegraph @

.github/workflows/update-changelog.yaml

raw
1 name: Update Changelog
2
3 on:
4 push:
5 branches:
6 - main
7 paths-ignore:
8 - CHANGELOG.md
9 workflow_dispatch:
10
11 permissions:
12 contents: read # Set default read-only permissions
13
14 jobs:
15 changelog:
16 runs-on: ubuntu-latest
17 permissions:
18 contents: write # For committing changelog
19 pull-requests: write # For creating PR
20 steps:
21 - name: Harden the Runner (Step Security)
22 uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
23 with:
24 egress-policy: audit
25
26 - name: Checkout Repo
27 uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
28 with:
29 fetch-depth: 0
30 persist-credentials: false
31
32 - name: Generate Changelog
33 uses: orhun/git-cliff-action@f50e11560dce63f7c33227798f90b924471a88b5 # v4.8.0
34 env:
35 OUTPUT: CHANGELOG.md
36 GITHUB_REPO: ${{ github.repository }}
37 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38 with:
39 config: cliff.toml
40 args: --verbose
41
42 - name: Create Pull Request for Changelog
43 id: create_pr
44 uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
45 with:
46 token: ${{ secrets.GITHUB_TOKEN }}
47 branch: docs/update-changelog
48 author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
49 committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
50 sign-commits: true
51 title: "docs(changelog): update changelog"
52 commit-message: "docs(changelog): update changelog"
53 body: "Automated changelog update"
54 delete-branch: true
55
56 - name: Enable auto-merge
57 if: "${{ steps.create_pr.outputs.pull-request-number }}"
58 env:
59 GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60 PULL_REQUEST_NUMBER: ${{ steps.create_pr.outputs.pull-request-number }}
61 run: gh pr merge --auto --squash "${PULL_REQUEST_NUMBER}"