Merge pull request #12314 from backstage/mob/pr
Use the custom PR action
This commit is contained in:
@@ -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'
|
||||
})
|
||||
Reference in New Issue
Block a user