Skip to content

Commit f112edf

Browse files
chore(ci): add PR files guard action; (#6890)
1 parent 61de4c0 commit f112edf

2 files changed

Lines changed: 36 additions & 0 deletions

File tree

.github/workflows/labeler.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ jobs:
1414
pull-requests: write
1515
runs-on: ubuntu-latest
1616
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
- name: git config
21+
run: |
22+
git config user.name "${GITHUB_ACTOR}"
23+
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
1724
- name: Set PR number
1825
id: set-pr
1926
run: |

.github/workflows/pr-guard.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: "PR files guard"
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
7+
jobs:
8+
check-dist:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
pull-requests: write
12+
steps:
13+
- uses: dorny/paths-filter@v3
14+
id: filter
15+
with:
16+
filters: |
17+
dist:
18+
- 'dist/**'
19+
20+
- name: Comment if dist/ was changed
21+
if: steps.filter.outputs.dist == 'true'
22+
uses: peter-evans/create-or-update-comment@v4
23+
with:
24+
token: ${{ secrets.GITHUB_TOKEN }}
25+
issue-number: ${{ github.event.pull_request.number }}
26+
body: |
27+
⚠️ **Warning!** You have made changes to the `dist/` directory.
28+
These files should not be edited manually as they will be built by our CI/CD pipeline during release.
29+
Please remove these changes from the pull request.

0 commit comments

Comments
 (0)