Skip to content

Commit aed6297

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

File tree

1 file changed

+32
-1
lines changed

1 file changed

+32
-1
lines changed

.github/workflows/pixi-lock.yml

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,33 @@ 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)
41+
core.setOutput('branch', data.head.ref)
42+
- name: Push plan
43+
run: |
44+
echo git push $REMOTE HEAD:$BRANCH
45+
env:
46+
REMOTE: ${{ steps.get-source-repo.outputs.remote }}
47+
BRANCH: ${{ steps.get-source-repo.outputs.branch }}
2148
- name: Set git identity
2249
run: |
2350
git config --global user.name "nipreps[bot]"
@@ -32,4 +59,8 @@ jobs:
3259
run: |
3360
uvx datalad run -i pixi.lock -i pyproject.toml -o pixi.lock -- pixi lock
3461
- name: Push updated lockfile, if needed
35-
run: git push
62+
run: |
63+
git push $REMOTE HEAD:$BRANCH
64+
env:
65+
REMOTE: ${{ steps.get-source-repo.outputs.remote }}
66+
BRANCH: ${{ steps.get-source-repo.outputs.branch }}

0 commit comments

Comments
 (0)