Skip to content

Commit 80b57c5

Browse files
ensure right code is checked out
1 parent fd5f6cb commit 80b57c5

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

.github/workflows/hook-dependencies-update.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ jobs:
3232
- name: auto-release
3333
run: Rscript -e 'source("renv/activate.R"); renv::restore(); renv::install("."); precommit:::auto_release()'
3434
- name: Create Pull Request
35+
id: cpr
3536
uses: peter-evans/create-pull-request@v7.0.7
3637
with:
3738
token: ${{ secrets.PRECOMMIT_HOOK_DEPENDENCY_UPDATE }}
@@ -44,7 +45,13 @@ jobs:
4445
This PR updates the hook dependencies in `renv.lock`, auto-generated by [create-pull-request][1]. Close and re-open this to trigger `on: pull_request` events to circumvent [limitation of GitHub actions](https://github.com/peter-evans/create-pull-request/blob/master/docs/concepts-guidelines.md#push-pull-request-branches-to-a-fork).
4546
4647
[1]: https://github.com/peter-evans/create-pull-request
47-
48+
- name: Checkout PR head SHA
49+
if: steps.cpr.outputs['pull-request-operation'] != 'none'
50+
uses: actions/checkout@v4
51+
with:
52+
ref: ${{ steps.cpr.outputs['pull-request-head-sha'] }}
53+
fetch-depth: 0 # good practice if you need history
54+
4855
- name: Push latest tag
4956
run: |
5057
Rscript -e "install.packages('desc')"

0 commit comments

Comments
 (0)