From d8ddf6a00eef41a33611d8be44dd939ecc4dc5c2 Mon Sep 17 00:00:00 2001 From: Dmitry Kruchinin <33020454+dvkruchinin@users.noreply.github.com> Date: Fri, 26 Feb 2021 15:51:11 +0300 Subject: [PATCH] Workflow. Change getting files from PR. (#2874) * Change getting file list from PR * Remove commands for debug --- .github/workflows/bandit.yml | 6 +++--- .github/workflows/eslint.yml | 6 +++--- .github/workflows/pylint.yml | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/bandit.yml b/.github/workflows/bandit.yml index eeb648ed4b72..a7f25b2bca32 100644 --- a/.github/workflows/bandit.yml +++ b/.github/workflows/bandit.yml @@ -5,12 +5,12 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - id: files - uses: jitterbit/get-changed-files@v1 - name: Run checks run: | - for files in ${{ steps.files.outputs.added_modified }}; do + URL="https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files" + PR_FILES=$(curl -s -X GET -G $URL | jq -r '.[] | .filename') + for files in $PR_FILES; do extension="${files##*.}" if [[ $extension == 'py' ]]; then changed_files_bandit+=" ${files}" diff --git a/.github/workflows/eslint.yml b/.github/workflows/eslint.yml index 0692cbd1419b..66709d052097 100644 --- a/.github/workflows/eslint.yml +++ b/.github/workflows/eslint.yml @@ -8,12 +8,12 @@ jobs: - uses: actions/setup-node@v2 with: node-version: 12 - - id: files - uses: jitterbit/get-changed-files@v1 - name: Run checks run: | - for files in ${{ steps.files.outputs.added_modified }}; do + URL="https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files" + PR_FILES=$(curl -s -X GET -G $URL | jq -r '.[] | .filename') + for files in $PR_FILES; do extension="${files##*.}" if [[ $extension == 'js' || $extension == 'ts' || $extension == 'jsx' || $extension == 'tsx' ]]; then changed_files_eslint+=" ${files}" diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index d1c545158a3d..612e16a1eb0c 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -5,12 +5,12 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - id: files - uses: jitterbit/get-changed-files@v1 - name: Run checks run: | - for files in ${{ steps.files.outputs.added_modified }}; do + URL="https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files" + PR_FILES=$(curl -s -X GET -G $URL | jq -r '.[] | .filename') + for files in $PR_FILES; do extension="${files##*.}" if [[ $extension == 'py' ]]; then changed_files_pylint+=" ${files}"