From 977911bf84dad2f21dc7d46688e04e7ca2c19288 Mon Sep 17 00:00:00 2001 From: Oliver Eyton-Williams Date: Fri, 7 Oct 2022 14:58:10 +0200 Subject: [PATCH] fix(autoclose): get the files before counting them (#47898) --- .github/workflows/autoclose.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/autoclose.yml b/.github/workflows/autoclose.yml index f99687ba754..4cc5d252c91 100644 --- a/.github/workflows/autoclose.yml +++ b/.github/workflows/autoclose.yml @@ -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"