chore: add auto-analyze.yml action (#1009)

Co-authored-by: th33xitus <domwil1091+github@gmail.com>
This commit is contained in:
Stefan Dej 2022-08-06 21:12:07 +02:00 committed by GitHub
parent 24932c088f
commit 98439b916b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

41
.github/workflows/auto-analyze.yml vendored Normal file
View 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']
})