From 0163fb056f171c56adfab54a65c4685fb3ce0a30 Mon Sep 17 00:00:00 2001 From: blam Date: Tue, 18 Jan 2022 18:31:19 +0100 Subject: [PATCH] chore: run the goalie Workflow Signed-off-by: blam --- .../workflows/{goalie-cron.yaml => goalie.yaml} | 14 ++++++-------- scripts/goalie-labels.js | 17 ++++++++--------- 2 files changed, 14 insertions(+), 17 deletions(-) rename .github/workflows/{goalie-cron.yaml => goalie.yaml} (76%) diff --git a/.github/workflows/goalie-cron.yaml b/.github/workflows/goalie.yaml similarity index 76% rename from .github/workflows/goalie-cron.yaml rename to .github/workflows/goalie.yaml index 24b037546a..ee0a6a248e 100644 --- a/.github/workflows/goalie-cron.yaml +++ b/.github/workflows/goalie.yaml @@ -1,10 +1,8 @@ # on a review from someone in the reviewers group, remove the awaiting-review label and add the awaiting-author label -name: Goalie Cron -on: push - -# on: -# schedule: -# - cron: "* * * * *" +name: Goalie Workflow +on: + schedule: + - cron: "* * * * *" jobs: label: @@ -14,8 +12,8 @@ jobs: id: get_workflow_token uses: peter-murray/workflow-application-token-action@v1 with: - application_id: ${{ secrets.BACKSTAGE_WORKFLOW_MEMBER_READ_APP_ID }} - application_private_key: ${{ secrets.BACKSTAGE_WORKFLOW_MEMBER_READ_PRIVATE_KEY }} + application_id: ${{ secrets.BACKSTAGE_GOALIE_APPLICATION_ID }} + application_private_key: ${{ secrets.BACKSTAGE_GOALIE_PRIVATE_KEY }} organization: backstage - uses: actions/checkout@v2 diff --git a/scripts/goalie-labels.js b/scripts/goalie-labels.js index 01ec5dee7c..e9765aebb8 100644 --- a/scripts/goalie-labels.js +++ b/scripts/goalie-labels.js @@ -89,15 +89,14 @@ module.exports = async ({ github, context, core }) => { } if (hasReviewed.size === expectedReviewers.size) { - console.log('should remove label'); - // await github.rest.issues.removeLabel({ - // issue_number: context.issue.number, - // owner: context.repo.owner, - // repo: context.repo.repo, - // name: 'awaiting-review' - // }).catch(() => {}); - } else { - console.log('should add label'); + await github.rest.issues + .removeLabel({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + name: 'awaiting-review', + }) + .catch(() => {}); } } };