Skip to content

Commit

Permalink
Add steps to work on push events(master)
Browse files Browse the repository at this point in the history
  • Loading branch information
atharva-2001 committed Aug 6, 2024
1 parent cfa24d7 commit d8d680e
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions .github/workflows/codestyle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
if: github.event_name != 'pull_request_target'
if: github.event_name == 'push'
with:
fetch-depth: 0

- name: Checkout PR and master branch
if: github.event_name == 'pull_request_target'
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
Expand All @@ -65,12 +66,22 @@ jobs:
cache-environment: true
cache-downloads: true

- name: Show statistics
- name: Show statistics pull request
if: github.event_name == 'pull_request_target'
run: ruff check --statistics --show-fixes $(git --no-pager diff --name-only origin/master HEAD --) | tee ruff_stats.txt

- name: Show entire output
- name: Show entire output pull request
if: github.event_name == 'pull_request_target'
run: ruff check --output-format=concise $(git --no-pager diff --name-only origin/master HEAD --) | tee ruff_full.txt

- name: Show statistics push
if: github.event_name == 'push'
run: ruff check --statistics --show-fixes . | tee ruff_stats.txt

- name: Show entire output push
if: github.event_name == 'push'
run: ruff check --output-format=concise . | tee ruff_full.txt

- name: Statistics output read
id: ruff_stats
uses: juliangruber/[email protected]
Expand Down

0 comments on commit d8d680e

Please sign in to comment.