-
-
Notifications
You must be signed in to change notification settings - Fork 340
44 lines (38 loc) · 1.42 KB
/
changes-in-high-risk-files.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
name: Changes In High Risk Files
on:
pull_request:
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
files-changed:
name: Detect changed files
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Get changed files
id: changes
uses: getsentry/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 # v2.11.1
with:
token: ${{ github.token }}
filters: .github/file-filters.yml
# Enable listing of files matching each filter.
# Paths to files will be available in `${FILTER_NAME}_files` output variable.
list-files: csv
validate-high-risk-files:
if: needs.files-changed.outputs.high_risk_files == 'true'
needs: files-changed
runs-on: ubuntu-latest
steps:
- name: Comment on PR to notify of changes in high risk files
uses: actions/github-script@v7
with:
script: |
const issue_number = context.issue.number;
github.issues.createComment({
issue_number: issue_number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Detected changes in high risk files. Take an extra careful look on these: ${FILTER_NAME}_files.'
});