Use the custom issue action

Co-authored-by: Patrik Oldsberg <poldsberg@gmail.com>
Co-authored-by: Johan Haals <johan.haals@gmail.com>
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2022-06-29 15:19:22 +02:00
parent 9c6e5ae7d2
commit 4ef6444671
4 changed files with 16 additions and 41 deletions
+1 -1
View File
@@ -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
+13
View File
@@ -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
+2 -2
View File
@@ -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 }}
-38
View File
@@ -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
});