Merge pull request #12314 from backstage/mob/pr

Use the custom PR action
This commit is contained in:
Fredrik Adelöw
2022-06-29 15:03:01 +02:00
committed by GitHub
2 changed files with 14 additions and 37 deletions
+14
View File
@@ -0,0 +1,14 @@
name: PR
on:
pull_request_target:
jobs:
generate-changeset:
runs-on: ubuntu-latest
if: github.repository == 'backstage/backstage'
steps:
- name: PR sync
uses: backstage/actions/pr-sync@v0.1.6
with:
github-token: ${{ secrets.GH_SERVICE_ACCOUNT_TOKEN }}
@@ -1,37 +0,0 @@
name: Approve renovate lock file changes
on:
pull_request_target:
paths:
- '.github/workflows/sync_renovate-changesets.yml'
- '**/yarn.lock'
jobs:
generate-changeset:
runs-on: ubuntu-latest
if: github.actor == 'renovate[bot]' && github.repository == 'backstage/backstage'
steps:
- name: Approve
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GH_SERVICE_ACCOUNT_TOKEN }}
script: |
const owner = 'backstage';
const repo = 'backstage';
const r = await github.rest.pulls.listFiles({
owner,
repo,
pull_number: context.issue.number,
});
if (r.data.some((f) => f.filename.split('/').slice(-1)[0] !== 'yarn.lock')) {
console.log('skipping approval since some files are not yarn.lock');
return;
}
await github.rest.pulls.createReview({
owner,
repo,
pull_number: context.issue.number,
event: 'APPROVE'
})