From 2c6c776f7b7dd734299cc66d07b5d343ec01347f Mon Sep 17 00:00:00 2001 From: Lucas Oliveira <62367544+tilucasoli@users.noreply.github.com> Date: Fri, 28 Jun 2024 13:09:54 -0300 Subject: [PATCH] Update add_label.yml --- .github/workflows/add_label.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/add_label.yml b/.github/workflows/add_label.yml index 8469d4505..ac5fb599b 100644 --- a/.github/workflows/add_label.yml +++ b/.github/workflows/add_label.yml @@ -13,6 +13,10 @@ jobs: - uses: actions/github-script@v7 with: script: | - const files = context.payload.pull_request - console.log(`Modified files on this PR: ${files}`) + const { execSync } = require('child_process') + const { commits } = context.payload.pull_request + const rawFiles = execSync(`git diff --name-only HEAD HEAD~${commits}`).toString() + const files = rawFiles.split('\n').filter(Boolean) + + console.log(files)