Skip to content

Commit 5c6f984

Browse files
committed
Update CI to run on PRs
1 parent aef01a3 commit 5c6f984

1 file changed

Lines changed: 17 additions & 2 deletions

File tree

.github/workflows/run.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,30 @@
11
name: Run pipeline
22

3-
on: push
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
48

59
permissions:
610
contents: write
711

12+
# Make sure we only ever run one per branch so we don't have issues pushing
13+
# after running the pipeline
14+
concurrency:
15+
group: calkit-run-${{ github.ref }}
16+
cancel-in-progress: false
17+
818
jobs:
919
main:
1020
name: Run
1121
runs-on: ubuntu-latest
1222
steps:
1323
- uses: actions/checkout@v4
24+
with:
25+
# For PRs, checkout the head ref to avoid detached HEAD
26+
ref: ${{ github.head_ref || github.ref_name }}
27+
token: ${{ secrets.GITHUB_TOKEN }}
1428
- name: Configure Git credentials
1529
run: |
1630
git config user.name github-actions[bot]
@@ -33,8 +47,9 @@ jobs:
3347
- run: calkit config remote-auth
3448
env:
3549
CALKIT_DVC_TOKEN: ${{ secrets.CALKIT_DVC_TOKEN }}
36-
- run: dvc pull
50+
- run: calkit dvc pull
3751
- run: calkit run
52+
# If running on a PR, push to that branch, else push to main
3853
- run: calkit save -am "Run pipeline"
3954
env:
4055
CALKIT_DVC_TOKEN: ${{ secrets.CALKIT_DVC_TOKEN }}

0 commit comments

Comments
 (0)