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:
9
.github/workflows/repo-sync.yml
vendored
9
.github/workflows/repo-sync.yml
vendored
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user