-
Notifications
You must be signed in to change notification settings - Fork 3
30 lines (25 loc) · 1.32 KB
/
auto-pr-desc.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
# This workflow updates the pull request description with an auto-generated section containing the categorised commit
# message headers of the pull request's commits. The auto generated section is enveloped between two comments:
# "<!--- START AUTOGENERATED NOTES --->" and "<!--- END AUTOGENERATED NOTES --->". Anything outside these in the
# description is left untouched. Auto-generated updates can be skipped for a commit if
# "<!--- SKIP AUTOGENERATED NOTES --->" is added to the pull request description.
name: generate-pull-request-description
on: [pull_request, push]
jobs:
update:
if: ${{ !contains(github.event.pull_request.body, '<!--- SKIP AUTOGENERATED NOTES --->') }}
runs-on: ubuntu-latest
steps:
# Step 1: Use an action to generate the pull request description
- name: Generate PR Description
uses: octue/generate-pull-request-description@main
id: pr-description
with:
pull_request_url: ${{ github.event.pull_request.url }}
api_token: ${{ secrets.GITHUB_TOKEN }}
# Step 2: Update the pull request body using the generated description
- name: Update pull request body
uses: riskledger/update-pr-description@v2
with:
body: ${{ steps.pr-description.outputs.pull_request_description }}
token: ${{ secrets.GITHUB_TOKEN }}