-
Notifications
You must be signed in to change notification settings - Fork 14
42 lines (40 loc) · 1.3 KB
/
rerun-skip-comment.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
name: "Auto approve"
on:
pull_request:
branches:
- main
jobs:
changed:
runs-on: ubuntu-latest
name: Get changed metric definition files
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get changed files in the metrics definitions folder
id: changed-files-specific
uses: tj-actions/changed-files@v34
with:
files: jetstream/defaults/*.toml
outputs:
any_changed: ${{ steps.changed-files-specific.outputs.any_changed }}
approve:
name: Leave a comment if defaults have been changed
permissions:
pull-requests: write
runs-on: ubuntu-latest
needs: changed
steps:
- uses: actions/github-script@v6
if: needs.changed.outputs.any_changed == 'true'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: "⚠️ Changing default metrics will cause all experiments that are currently live to get rerun after this change has been merged. This may come with a substantial cost. To skip reruns, add `[ci skip-rerun]` to the PR message."
})