forked from microsoft/FluidFramework
-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (58 loc) · 3.15 KB
/
changeset-reporter.yml
File metadata and controls
67 lines (58 loc) · 3.15 KB
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
64
65
66
67
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
permissions:
contents: read
jobs:
load_report:
permissions:
pull-requests: write # for marocchino/sticky-pull-request-comment to create or update PR comment
runs-on: ubuntu-latest
steps:
# release notes: https://github.com/actions/checkout/releases/tag/v6.0.0
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # ratchet:actions/checkout@v6
with:
persist-credentials: false
- name: Download results
# release notes: https://github.com/dawidd6/action-download-artifact/releases/tag/v11
uses: dawidd6/action-download-artifact@ac66b43f0e6a346234dd65d4d0c8fbb31cb316e5 # ratchet:dawidd6/action-download-artifact@v11
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.4
uses: marocchino/sticky-pull-request-comment@773744901bac0e8cbb5a0dc842800d45e9b2b405 # ratchet:marocchino/sticky-pull-request-comment@v2
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.4
uses: marocchino/sticky-pull-request-comment@773744901bac0e8cbb5a0dc842800d45e9b2b405 # ratchet:marocchino/sticky-pull-request-comment@v2
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.4
uses: marocchino/sticky-pull-request-comment@773744901bac0e8cbb5a0dc842800d45e9b2b405 # ratchet:marocchino/sticky-pull-request-comment@v2
with:
header: changeset
number: ${{ fromJson(steps.changeset.outputs.CHANGESET).pr }}
delete: true