From 94659705b15a5e63fdd1aaa9e6628f4eec39c806 Mon Sep 17 00:00:00 2001 From: "James M. Greene" Date: Sat, 18 Dec 2021 14:31:40 -0600 Subject: [PATCH] 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 --- .github/workflows/repo-sync.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/repo-sync.yml b/.github/workflows/repo-sync.yml index 91fd69211b..ee8ef065c1 100644 --- a/.github/workflows/repo-sync.yml +++ b/.github/workflows/repo-sync.yml @@ -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