forked from microsoft/FluidFramework
-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (55 loc) · 2.91 KB
/
changeset-reporter.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
53
54
55
56
57
58
59
60
61
62
63
name: changeset-reporter
# This workflow adds a comment to the PR depending on the results of the pr-check-changeset workflow.
#
# The workflows are separated for security reasons. This workflow requires write access to the repo, but the
# pr-check-changeset workflow does not.
on:
workflow_run:
workflows: ["pr-check-changeset"]
types:
- completed
jobs:
load_report:
runs-on: ubuntu-latest
permissions:
actions: read
pull-requests: write
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # ratchet:actions/checkout@v3
with:
persist-credentials: false
- name: Download results
uses: dawidd6/action-download-artifact@bd10f381a96414ce2b13a11bfa89902ba7cea07f # ratchet:dawidd6/[email protected]
with:
workflow: pr-check-changeset.yml
run_id: ${{ github.event.workflow_run.id }}
name: changeset-metadata
- name: Load changeset metadata into output variable
id: changeset
run: echo "CHANGESET=$(cat changeset-metadata.json)" >> $GITHUB_OUTPUT
- name: Required but missing
if: fromJson(steps.changeset.outputs.CHANGESET).required == true && fromJson(steps.changeset.outputs.CHANGESET).changesetFound == false
# release notes: https://github.com/marocchino/sticky-pull-request-comment/releases/tag/v2.9.0
uses: marocchino/sticky-pull-request-comment@331f8f5b4215f0445d3c07b4967662a32a2d3e31 # ratchet:marocchino/[email protected]
with:
header: changeset
number: ${{ fromJson(steps.changeset.outputs.CHANGESET).pr }}
path: ${{ github.workspace }}/.github/workflows/data/changeset-missing.md
- name: Required and present
if: fromJson(steps.changeset.outputs.CHANGESET).required == true && fromJson(steps.changeset.outputs.CHANGESET).changesetFound == true
# release notes: https://github.com/marocchino/sticky-pull-request-comment/releases/tag/v2.9.0
uses: marocchino/sticky-pull-request-comment@331f8f5b4215f0445d3c07b4967662a32a2d3e31 # ratchet:marocchino/[email protected]
with:
header: changeset
number: ${{ fromJson(steps.changeset.outputs.CHANGESET).pr }}
recreate: true
message: |
This PR requires a changeset and it has one! Good job!
- name: Changeset not required
if: fromJson(steps.changeset.outputs.CHANGESET).required == false && fromJson(steps.changeset.outputs.CHANGESET).changesetFound == true
# release notes: https://github.com/marocchino/sticky-pull-request-comment/releases/tag/v2.9.0
uses: marocchino/sticky-pull-request-comment@331f8f5b4215f0445d3c07b4967662a32a2d3e31 # ratchet:marocchino/[email protected]
with:
header: changeset
number: ${{ fromJson(steps.changeset.outputs.CHANGESET).pr }}
delete: true