Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.

Commit 986c861

Browse files
authored
Merge pull request #815 from datafold/fix/formatter-github-action
Fix github action that doesn't work with forked branches
2 parents db7d864 + 280b7c5 commit 986c861

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

.github/workflows/formatter.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,23 @@ jobs:
1010
name: runner / ruff
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v3
13+
- name: Checkout PR head
14+
uses: actions/checkout@v3
15+
if: github.event_name == 'pull_request'
16+
with:
17+
repository: ${{ github.event.pull_request.head.repo.full_name }}
18+
ref: ${{ github.event.pull_request.head.ref }}
19+
20+
- name: Checkout Repo
21+
uses: actions/checkout@v3
22+
if: github.event_name == 'workflow_dispatch'
23+
1424
- name: Check files using the ruff formatter
1525
uses: chartboost/ruff-action@v1
1626
id: ruff_formatter
1727
with:
1828
args: format
29+
1930
- name: Auto commit ruff formatting
2031
uses: stefanzweifel/git-auto-commit-action@v5
2132
with:

0 commit comments

Comments
 (0)