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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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 }}
|
||||
|
||||
@@ -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
|
||||
});
|
||||
Reference in New Issue
Block a user