From 6353216c1908325db04821d5b0d554195a18453d Mon Sep 17 00:00:00 2001 From: Ben Evans <49054298+bsanevans@users.noreply.github.com> Date: Thu, 23 Nov 2023 17:45:25 +0900 Subject: [PATCH] Create add-feedback-to-project.yml Part of GitHub updates. Testing new script. --- .github/workflows/add-feedback-to-project.yml | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/add-feedback-to-project.yml diff --git a/.github/workflows/add-feedback-to-project.yml b/.github/workflows/add-feedback-to-project.yml new file mode 100644 index 000000000..89348a54b --- /dev/null +++ b/.github/workflows/add-feedback-to-project.yml @@ -0,0 +1,36 @@ +### https://github.com/WordPress/Documentation-Issue-Tracker/blob/main/.github/workflows/actions-when-commented.yml + +name: Label and move feedback to correct project when commented with command +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@v7.0.1 + with: + script: console.log(context) + + - uses: actions/github-script@v7.0.1 + if: contains(github.event.issue.labels.*.name, 'Awaiting Triage') && contains(github.event.comment.body, '/content') + with: + script: | + github.rest.issues.removeLabel({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + name: ["[Type] Bug"] + }) + github.rest.issues.addLabels({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + labels: ["Content Feedback"] + })