Skip to content

Commit b879c6c

Browse files
committed
Find submitting repo
1 parent c24bbcf commit b879c6c

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

.github/workflows/pixi-lock.yml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,21 @@ jobs:
2323
GITHUB_CONTEXT: ${{ toJson(github) }}
2424
run: |
2525
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.full_name)
2641
- name: Set git identity
2742
run: |
2843
git config --global user.name "nipreps[bot]"
@@ -38,7 +53,7 @@ jobs:
3853
uvx datalad run -i pixi.lock -i pyproject.toml -o pixi.lock -- pixi lock
3954
- name: Push updated lockfile, if needed
4055
run: |
41-
git fetch origin refs/pull/$PULL/head
42-
git push origin HEAD:refs/pull/$PULL/head
56+
git push $REMOTE HEAD:refs/pull/$PULL/head
4357
env:
44-
PULL: ${{ github.event.pull_request.number }}
58+
REMOTE: ${{ steps.get-source-repo.outputs.remote }}
59+
PULL: ${{ github.event.number }}

0 commit comments

Comments
 (0)