Skip to content

[HelpHub] [6.4] Gallery Block #458

[HelpHub] [6.4] Gallery Block

[HelpHub] [6.4] Gallery Block #458

# https://github.com/marketplace/actions/github-script
name: Label issue when assigned
on:
issues:
types: [assigned]
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] To do')
with:
script: |
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ["[Status] In progress"]
})
github.rest.issues.removeLabel({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
name: ["[Status] To do"]
})
# - uses: actions/github-script@v6
# if: contains(github.event.issue.labels.*.name, '[Status] To do') && ${{ !github.event.issue.assignee }}
# with:
# script: |
# github.rest.issues.removeLabel({
# issue_number: context.issue.number,
# owner: context.repo.owner,
# repo: context.repo.repo,
# name: ["[Status] To do"]
# })
# - uses: actions/github-script@v6
# if: contains(github.event.issue.labels.*.name, '[Status] Done') && ${{ !github.event.issue.assignee }}
# with:
# script: |
# github.rest.issues.removeLabel({
# issue_number: context.issue.number,
# owner: context.repo.owner,
# repo: context.repo.repo,
# name: ["[Status] Done"]
# })
# - uses: actions/github-script@v6
# if: contains(github.event.issue.labels.*.name, '[Status] Review') && ${{ !github.event.issue.assignee }}
# with:
# script: |
# github.rest.issues.removeLabel({
# issue_number: context.issue.number,
# owner: context.repo.owner,
# repo: context.repo.repo,
# name: ["[Status] Review"]
# })