From 4ef64446717b824dc63a182fe8fd46fc4dbfeacb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Wed, 29 Jun 2022 15:19:22 +0200 Subject: [PATCH] Use the custom issue action MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Patrik Oldsberg Co-authored-by: Johan Haals Signed-off-by: Fredrik Adelöw --- .github/workflows/cron.yml | 2 +- .github/workflows/issue.yaml | 13 +++++++++ .github/workflows/pr.yaml | 4 +-- .github/workflows/sync_issue-labels.yml | 38 ------------------------- 4 files changed, 16 insertions(+), 41 deletions(-) create mode 100644 .github/workflows/issue.yaml delete mode 100644 .github/workflows/sync_issue-labels.yml diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml index 52a68a7d90..4d1ba7fc0e 100644 --- a/.github/workflows/cron.yml +++ b/.github/workflows/cron.yml @@ -8,4 +8,4 @@ jobs: cron: runs-on: ubuntu-latest steps: - - uses: backstage/actions/cron@v0.1.4 + - uses: backstage/actions/cron@v0.1.8 diff --git a/.github/workflows/issue.yaml b/.github/workflows/issue.yaml new file mode 100644 index 0000000000..972f90795c --- /dev/null +++ b/.github/workflows/issue.yaml @@ -0,0 +1,13 @@ +name: Issue +on: + issues: + types: [opened] + +jobs: + sync: + runs-on: ubuntu-latest + + if: github.repository == 'backstage/backstage' + steps: + - name: Issue sync + uses: backstage/actions/issue-sync@v0.1.8 diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 0d4fd01ca5..01254a53a8 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -3,12 +3,12 @@ on: pull_request_target: jobs: - generate-changeset: + sync: runs-on: ubuntu-latest if: github.repository == 'backstage/backstage' steps: - name: PR sync - uses: backstage/actions/pr-sync@v0.1.6 + uses: backstage/actions/pr-sync@v0.1.8 with: github-token: ${{ secrets.GH_SERVICE_ACCOUNT_TOKEN }} diff --git a/.github/workflows/sync_issue-labels.yml b/.github/workflows/sync_issue-labels.yml deleted file mode 100644 index 91b5f79f5d..0000000000 --- a/.github/workflows/sync_issue-labels.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Sync Issue Labels -on: - issues: - types: [opened] -jobs: - label-issue: - runs-on: ubuntu-latest - if: github.repository == 'backstage/backstage' - steps: - - name: View context attributes - uses: actions/github-script@v6 - with: - script: | - const keywords = { - 'techdocs|tech-docs|tech docs': 'docs-like-code', - 'search': 'search', - 'catalog': 'catalog', - 'scaffolder': 'scaffolder', - }; - - const labels = Object.entries(keywords) - .map(([regexp, label]) => { - if (new RegExp(regexp, 'gi').test(context.payload.issue.title)) { - return label; - } - }) - .filter(Boolean); - - if(!labels.length) { - return; - } - - github.rest.issues.addLabels({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - labels - });