Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add auto-analyze.yml action #1009

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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']
})