chore: add auto-analyze.yml action (#1009)
Co-authored-by: th33xitus <domwil1091+github@gmail.com>
This commit is contained in:
parent
24932c088f
commit
98439b916b
41
.github/workflows/auto-analyze.yml
vendored
Normal file
41
.github/workflows/auto-analyze.yml
vendored
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
name: 'Auto add analyze label if package.json was edited'
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- develop
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
add-analyze-label:
|
||||||
|
name: 'Add analyze label'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Get changed files
|
||||||
|
id: changed-files
|
||||||
|
uses: tj-actions/changed-files@v24.1
|
||||||
|
|
||||||
|
- name: Get package.json is changed file
|
||||||
|
id: changed-file-package-json
|
||||||
|
uses: tj-actions/changed-files@v24.1
|
||||||
|
with:
|
||||||
|
files: |
|
||||||
|
package.json
|
||||||
|
|
||||||
|
- name: Add Label
|
||||||
|
if: steps.changed-file-package-json.outputs.any_changed == 'true'
|
||||||
|
uses: actions/github-script@v6
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
github.rest.issues.addLabels({
|
||||||
|
issue_number: context.issue.number,
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
labels: ['analyze']
|
||||||
|
})
|
Loading…
x
Reference in New Issue
Block a user