42 lines
1002 B
YAML
42 lines
1002 B
YAML
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']
|
|
})
|