Skip to content

Commit 68cdb7b

Browse files
committed
gha: git steps (checkout, branch, commit, push)
1 parent 5495c8d commit 68cdb7b

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

.github/workflows/lockfiles.yaml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,20 @@ jobs:
317317
RESOLVES_CSV: ${{ join(fromJSON(needs.resolves.ouptuts.JSON), ', ') }}
318318
LOCKFILES: ${{ needs.resolves.outputs.LOCKFILES }}
319319
steps:
320+
- name: Checkout repository
321+
uses: actions/checkout@v4
322+
with:
323+
# a test uses a submodule, and pants needs access to it to calculate deps.
324+
submodules: 'true'
325+
ref: ${{ needs.pr.outputs.CHECKOUT_REF }}
326+
327+
- name: Create branch for new PR
328+
if: ${{ inputs.pr == 'new' }}
329+
run: |
330+
git config --local user.name "github-actions[bot]"
331+
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
332+
git checkout -b "${{ needs.pr.outputs.PR_REF }}" FETCH_HEAD
333+
320334
- name: Download lockfiles and lockfile diff files
321335
uses: actions/download-artifact@v5
322336
with:
@@ -358,4 +372,7 @@ jobs:
358372
fi
359373
done
360374
361-
# TODO: create commit to combine all of the updates in one commit
375+
- name: Commit and push
376+
run: |
377+
git commit -F "${COMMIT_MSG}"
378+
git push -u origin "${{ needs.pr.outputs.PR_REF }}"

0 commit comments

Comments
 (0)