Skip to content

Commit 8d5426c

Browse files
committed
chore(ci): Try to push to PR head
1 parent ba8f95b commit 8d5426c

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

.github/workflows/pixi-lock.yml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,26 @@ jobs:
1818
with:
1919
ref: ${{ github.event.pull_request.head.sha }}
2020
token: ${{ secrets.GITHUB_TOKEN }}
21+
- name: Dump GitHub context
22+
env:
23+
GITHUB_CONTEXT: ${{ toJson(github) }}
24+
run: |
25+
echo "$GITHUB_CONTEXT"
26+
- name: Find submitting repository
27+
id: get-source-repo
28+
uses: actions/github-script@v8
29+
env:
30+
OWNER: ${{ github.repository_owner }}
31+
REPO: ${{ github.repository }}
32+
PULL: ${{ github.event.number }}
33+
with:
34+
script: |
35+
const { data } = await github.rest.pulls.get({
36+
owner: process.env.OWNER,
37+
repo: process.env.REPO.split('/')[1],
38+
pull_number: process.env.PULL,
39+
});
40+
core.setOutput('remote', data.head.repo.html_url)
2141
- name: Set git identity
2242
run: |
2343
git config --global user.name "nipreps[bot]"
@@ -32,4 +52,8 @@ jobs:
3252
run: |
3353
uvx datalad run -i pixi.lock -i pyproject.toml -o pixi.lock -- pixi lock
3454
- name: Push updated lockfile, if needed
35-
run: git push
55+
run: |
56+
git push $REMOTE HEAD:refs/pull/$PULL/head
57+
env:
58+
REMOTE: ${{ steps.get-source-repo.outputs.remote }}
59+
PULL: ${{ github.event.number }}

0 commit comments

Comments
 (0)