Skip to content

Commit

Permalink
Workflow. Change getting files from PR. (#2874)
Browse files Browse the repository at this point in the history
* Change getting file list from PR

* Remove commands for debug
  • Loading branch information
dvkruchinin authored Feb 26, 2021
1 parent 8c397c5 commit d8ddf6a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/bandit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down

0 comments on commit d8ddf6a

Please sign in to comment.