1
0
mirror of synced 2026-01-04 09:06:46 -05:00

Alternative repo-sync fixes (#23892)

* Info is in the data prop

* Don't bother to comment when closing our own automated repo-sync PRs

Co-authored-by: Robert Sese <sese@github.com>
This commit is contained in:
James M. Greene
2021-12-18 14:31:40 -06:00
committed by GitHub
parent b9b3c65feb
commit 94659705b1

View File

@@ -223,7 +223,7 @@ jobs:
github-token: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}
result-encoding: string
script: |
const prFiles = await github.pulls.listFiles({
const { data: prFiles } = await github.pulls.listFiles({
...context.repo,
pull_number: process.env.PR_NUMBER,
})
@@ -238,13 +238,6 @@ jobs:
run: |
gh pr close ${{ steps.find-pull-request.outputs.number }} --repo $GITHUB_REPOSITORY
- name: Comment on the pull request if no files remain
if: ${{ steps.find-pull-request.outputs.number && steps.pr-files.outputs.count == '0' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr comment ${{ steps.find-pull-request.outputs.number }} --repo $GITHUB_REPOSITORY --body "This pull request was closed because it no longer contained any changes."
- name: Approve pull request
if: ${{ steps.find-pull-request.outputs.number && steps.pr-files.outputs.count != '0' }}
uses: juliangruber/approve-pull-request-action@c530832d4d346c597332e20e03605aa94fa150a8