Add front end change guard
This commit is contained in:
parent
1cde6b2eff
commit
34f82b01df
|
@ -0,0 +1,38 @@
|
||||||
|
# Guard any changes under web/ directory
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- master
|
||||||
|
paths:
|
||||||
|
- "web/**"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
commentIfWebChanges:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: ${{ !contains(github.event.pull_request.labels.*.name, 'Direct FrontEnd Change') }}
|
||||||
|
steps:
|
||||||
|
- name: Post comment on PR and apply label
|
||||||
|
uses: actions/github-script@v6
|
||||||
|
with:
|
||||||
|
github-token: ${{secrets.GITHUB_TOKEN}}
|
||||||
|
script: |
|
||||||
|
const issue_number = context.issue.number;
|
||||||
|
|
||||||
|
// Add comment
|
||||||
|
const message = "No direct changes are allowed in the web/ directory."
|
||||||
|
"Please submit the change to https://github.com/Comfy-Org/ComfyUI_frontend";
|
||||||
|
github.rest.issues.createComment({
|
||||||
|
issue_number: issue_number,
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
body: message
|
||||||
|
});
|
||||||
|
// Apply label
|
||||||
|
github.rest.issues.addLabels({
|
||||||
|
issue_number: issue_number,
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
labels: ['Direct FrontEnd Change']
|
||||||
|
});
|
Loading…
Reference in New Issue