|
1 | 1 | name: Update ChangeLogs |
2 | 2 |
|
3 | 3 | on: |
4 | | - workflow_dispatch: |
| 4 | + workflow_dispatch: |
5 | 5 |
|
6 | 6 | concurrency: |
7 | | - group: update-changelogs-${{ github.ref }} |
8 | | - cancel-in-progress: true |
| 7 | + group: update-changelogs-${{ github.ref }} |
| 8 | + cancel-in-progress: true |
9 | 9 |
|
10 | 10 | permissions: |
11 | | - contents: write |
12 | | - pull-requests: write |
13 | | - actions: write |
14 | | - checks: write |
15 | | - issues: write |
16 | | - statuses: write |
| 11 | + contents: write |
| 12 | + pull-requests: write |
| 13 | + actions: write |
| 14 | + checks: write |
| 15 | + issues: write |
| 16 | + statuses: write |
17 | 17 |
|
18 | 18 | jobs: |
19 | | - update_changelogs: |
20 | | - runs-on: windows-latest |
21 | | - steps: |
22 | | - - name: Harden the runner (Audit all outbound calls) |
23 | | - uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1 |
24 | | - with: |
25 | | - egress-policy: audit |
| 19 | + update_changelogs: |
| 20 | + runs-on: windows-latest |
| 21 | + steps: |
| 22 | + - name: Harden the runner (Audit all outbound calls) |
| 23 | + uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1 |
| 24 | + with: |
| 25 | + egress-policy: audit |
26 | 26 |
|
27 | | - - name: Checkout repository (Full history) |
28 | | - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 |
29 | | - with: |
30 | | - fetch-depth: 0 |
| 27 | + - name: Checkout repository (Full history) |
| 28 | + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 |
| 29 | + with: |
| 30 | + fetch-depth: 0 |
31 | 31 |
|
32 | | - - name: Create Check Run |
33 | | - id: create_check |
34 | | - env: |
35 | | - GH_TOKEN: ${{ github.token }} |
36 | | - shell: pwsh |
37 | | - run: | |
38 | | - $checkId = gh api -X POST -H "Accept: application/vnd.github+json" ` |
39 | | - -H "X-GitHub-Api-Version: 2022-11-28" ` |
40 | | - -f name='Update ChangeLogs' ` |
41 | | - -f head_sha='${{ github.sha }}' ` |
42 | | - -f status='in_progress' ` |
43 | | - -f 'output[title]=Update ChangeLogs' ` |
44 | | - -f 'output[summary]=Changelog update in progress' ` |
45 | | - --jq '.id' ` |
46 | | - /repos/${{ github.repository }}/check-runs |
47 | | - echo "CHECKID=$checkId" | Out-File -FilePath $env:GITHUB_ENV -Append |
| 32 | + - name: Create Check Run |
| 33 | + id: create_check |
| 34 | + env: |
| 35 | + GH_TOKEN: ${{ github.token }} |
| 36 | + shell: pwsh |
| 37 | + run: | |
| 38 | + $checkId = gh api -X POST -H "Accept: application/vnd.github+json" ` |
| 39 | + -H "X-GitHub-Api-Version: 2022-11-28" ` |
| 40 | + -f name='Update ChangeLogs' ` |
| 41 | + -f head_sha='${{ github.sha }}' ` |
| 42 | + -f status='in_progress' ` |
| 43 | + -f 'output[title]=Update ChangeLogs' ` |
| 44 | + -f 'output[summary]=Changelog update in progress' ` |
| 45 | + --jq '.id' ` |
| 46 | + /repos/${{ github.repository }}/check-runs |
| 47 | + echo "CHECKID=$checkId" | Out-File -FilePath $env:GITHUB_ENV -Append |
48 | 48 |
|
49 | | - - name: Set up Node.js |
50 | | - uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0 |
51 | | - with: |
52 | | - node-version: "20" |
| 49 | + - name: Set up Node.js |
| 50 | + uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0 |
| 51 | + with: |
| 52 | + node-version: "20" |
53 | 53 |
|
54 | | - - name: Install git-cliff |
55 | | - shell: pwsh |
56 | | - run: npm install -g git-cliff |
| 54 | + - name: Install git-cliff |
| 55 | + shell: pwsh |
| 56 | + run: npm install -g git-cliff |
57 | 57 |
|
58 | | - - name: Generate CHANGELOG.md files (With verbose logging) |
59 | | - shell: pwsh |
60 | | - run: | |
61 | | - echo "Generating changelogs with git-cliff..." |
62 | | - npx git-cliff --config cliff.toml --verbose --output CHANGELOG.md |
63 | | - Get-ChildItem -Name |
| 58 | + - name: Generate CHANGELOG.md files (With verbose logging) |
| 59 | + shell: pwsh |
| 60 | + run: | |
| 61 | + echo "Generating changelogs with git-cliff..." |
| 62 | + npx git-cliff --config cliff.toml --verbose --output CHANGELOG.md |
| 63 | + Get-ChildItem -Name |
64 | 64 |
|
65 | | - - name: Create Pull Request for changelogs |
66 | | - uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8 |
67 | | - with: |
68 | | - commit-message: "chore: update changelogs [skip ci]" |
69 | | - title: "chore: update changelogs" |
70 | | - body: "Automated changelog update via GitHub Actions.\n\nThis PR was created automatically and will not be merged automatically." |
71 | | - branch: "chore/update-changelogs" |
72 | | - add-paths: "**/CHANGELOG.md" |
73 | | - delete-branch: false |
74 | | - token: ${{ secrets.GITHUB_TOKEN }} |
| 65 | + - name: Create Pull Request for changelogs |
| 66 | + uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8 |
| 67 | + with: |
| 68 | + commit-message: "chore: update changelogs [skip ci]" |
| 69 | + title: "chore: update changelogs" |
| 70 | + body: "Automated changelog update via GitHub Actions.\n\nThis PR was created automatically and will not be merged automatically." |
| 71 | + branch: "chore/update-changelogs" |
| 72 | + add-paths: "**/CHANGELOG.md" |
| 73 | + delete-branch: false |
| 74 | + token: ${{ secrets.GITHUB_TOKEN }} |
75 | 75 |
|
76 | | - - name: Update Check Run - Changelogs Generated |
77 | | - if: success() |
78 | | - env: |
79 | | - GH_TOKEN: ${{ github.token }} |
80 | | - shell: pwsh |
81 | | - run: | |
82 | | - $body = @' |
83 | | - { |
84 | | - "status": "in_progress", |
85 | | - "output": { |
86 | | - "title": "Update ChangeLogs", |
87 | | - "summary": "Changelogs generated. Creating PR..." |
88 | | - } |
89 | | - } |
90 | | - '@ |
91 | | - $body | gh api -X PATCH -H "Accept: application/vnd.github+json" ` |
92 | | - -H "X-GitHub-Api-Version: 2022-11-28" ` |
93 | | - /repos/${{ github.repository }}/check-runs/$env:CHECKID --input - |
| 76 | + - name: Update Check Run - Changelogs Generated |
| 77 | + if: success() |
| 78 | + env: |
| 79 | + GH_TOKEN: ${{ github.token }} |
| 80 | + shell: pwsh |
| 81 | + run: | |
| 82 | + $body = @' |
| 83 | + { |
| 84 | + "status": "in_progress", |
| 85 | + "output": { |
| 86 | + "title": "Update ChangeLogs", |
| 87 | + "summary": "Changelogs generated. Creating PR..." |
| 88 | + } |
| 89 | + } |
| 90 | + '@ |
| 91 | + $body | gh api -X PATCH -H "Accept: application/vnd.github+json" ` |
| 92 | + -H "X-GitHub-Api-Version: 2022-11-28" ` |
| 93 | + /repos/${{ github.repository }}/check-runs/$env:CHECKID --input - |
94 | 94 |
|
95 | | - - name: Complete Check Run |
96 | | - if: always() |
97 | | - env: |
98 | | - GH_TOKEN: ${{ github.token }} |
99 | | - shell: pwsh |
100 | | - run: | |
101 | | - $body = @' |
102 | | - { |
103 | | - "conclusion": "success", |
104 | | - "output": { |
105 | | - "title": "Update ChangeLogs", |
106 | | - "summary": "Changelog update workflow completed successfully." |
107 | | - } |
108 | | - } |
109 | | - '@ |
110 | | - $body | gh api -X PATCH -H "Accept: application/vnd.github+json" ` |
111 | | - -H "X-GitHub-Api-Version: 2022-11-28" ` |
112 | | - /repos/${{ github.repository }}/check-runs/$env:CHECKID --input - |
| 95 | + - name: Complete Check Run |
| 96 | + if: always() |
| 97 | + env: |
| 98 | + GH_TOKEN: ${{ github.token }} |
| 99 | + shell: pwsh |
| 100 | + run: | |
| 101 | + $body = @' |
| 102 | + { |
| 103 | + "conclusion": "success", |
| 104 | + "output": { |
| 105 | + "title": "Update ChangeLogs", |
| 106 | + "summary": "Changelog update workflow completed successfully." |
| 107 | + } |
| 108 | + } |
| 109 | + '@ |
| 110 | + $body | gh api -X PATCH -H "Accept: application/vnd.github+json" ` |
| 111 | + -H "X-GitHub-Api-Version: 2022-11-28" ` |
| 112 | + /repos/${{ github.repository }}/check-runs/$env:CHECKID --input - |
113 | 113 |
|
114 | | - - name: Add Job Summary |
115 | | - if: always() |
116 | | - shell: pwsh |
117 | | - run: | |
118 | | - Add-Content -Path $env:GITHUB_STEP_SUMMARY "## 📝 Changelog Update Workflow Summary" |
119 | | - Add-Content -Path $env:GITHUB_STEP_SUMMARY "- CHANGELOG.md files were generated or updated in the repository and subfolders." |
120 | | - Add-Content -Path $env:GITHUB_STEP_SUMMARY "- A pull request was created or updated with the new changelogs." |
121 | | - Add-Content -Path $env:GITHUB_STEP_SUMMARY "- Check runs were updated to reflect the workflow status." |
122 | | - Add-Content -Path $env:GITHUB_STEP_SUMMARY "- Workflow completed with status: ${{ job.status }}". |
| 114 | + - name: Add Job Summary |
| 115 | + if: always() |
| 116 | + shell: pwsh |
| 117 | + run: | |
| 118 | + Add-Content -Path $env:GITHUB_STEP_SUMMARY "## 📝 Changelog Update Workflow Summary" |
| 119 | + Add-Content -Path $env:GITHUB_STEP_SUMMARY "- CHANGELOG.md files were generated or updated in the repository and subfolders." |
| 120 | + Add-Content -Path $env:GITHUB_STEP_SUMMARY "- A pull request was created or updated with the new changelogs." |
| 121 | + Add-Content -Path $env:GITHUB_STEP_SUMMARY "- Check runs were updated to reflect the workflow status." |
| 122 | + Add-Content -Path $env:GITHUB_STEP_SUMMARY "- Workflow completed with status: ${{ job.status }}". |
0 commit comments