Skip to content

[Theme Handbook Overhaul] Getting Started > Reading this handbook #155

[Theme Handbook Overhaul] Getting Started > Reading this handbook

[Theme Handbook Overhaul] Getting Started > Reading this handbook #155

# https://github.com/marketplace/actions/github-script
# https://github.com/orgs/community/discussions/25389#discussioncomment-3247738
name: Label issue when commented
on:
issue_comment:
types: [created, edited]
jobs:
label_issues:
if: ${{ !github.event.issue.pull_request }}
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- uses: actions/github-script@v6
with:
script: console.log(context)
- uses: actions/github-script@v6
if: contains(github.event.issue.labels.*.name, '[Status] In progress') && contains(github.event.comment.body, '/review') # check the comment if it contains the keywords
with:
script: |
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ["[Status] Review"]
})
github.rest.issues.removeLabel({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
name: ["[Status] In progress"]
})