Skip to content

Commit

Permalink
chore: add auto-analyze.yml action (#1009)
Browse files Browse the repository at this point in the history
Co-authored-by: th33xitus <[email protected]>
  • Loading branch information
meteyou and dw-0 authored Aug 6, 2022
1 parent 24932c0 commit 98439b9
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/auto-analyze.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]

- name: Get package.json is changed file
id: changed-file-package-json
uses: tj-actions/[email protected]
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']
})

0 comments on commit 98439b9

Please sign in to comment.