From 982f7814b13f31330c7337c1f693f5a075ea849c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Wed, 29 Jun 2022 15:01:16 +0200 Subject: [PATCH] Use the custom PR 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/pr.yaml | 14 +++++++ .../workflows/sync_approve_renovate_pr.yaml | 37 ------------------- 2 files changed, 14 insertions(+), 37 deletions(-) create mode 100644 .github/workflows/pr.yaml delete mode 100644 .github/workflows/sync_approve_renovate_pr.yaml diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml new file mode 100644 index 0000000000..0d4fd01ca5 --- /dev/null +++ b/.github/workflows/pr.yaml @@ -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 }} diff --git a/.github/workflows/sync_approve_renovate_pr.yaml b/.github/workflows/sync_approve_renovate_pr.yaml deleted file mode 100644 index 2d25bea223..0000000000 --- a/.github/workflows/sync_approve_renovate_pr.yaml +++ /dev/null @@ -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' - })