fix(autoclose): get the files before counting them (#47898)

This commit is contained in:
Oliver Eyton-Williams
2022-10-07 14:58:10 +02:00
committed by GitHub
parent 023dcd6a25
commit 977911bf84

View File

@@ -14,6 +14,11 @@ jobs:
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const files = await github.rest.pulls.listFiles({
owner: context.payload.repository.owner.login,
repo: context.payload.repository.name,
pull_number: context.payload.pull_request.number,
});
if (
files.data.length !== 1 ||
files.data[0].filename !== ".gitignore"