Skip to content

Commit

Permalink
🐛 Switch to Pull Request branch and not HEAD ref
Browse files Browse the repository at this point in the history
Patch at 1631a18 doesn't actually work. Need to checkout the Pull Request branch instead of the HEAD ref. Fixes error like `fatal: You are not currently on a branch. To push the history leading to the current (detached HEAD)
state now, use ...`. Xref actions/checkout#331 (comment)
  • Loading branch information
weiji14 committed Aug 24, 2023
1 parent 1631a18 commit 0f280e7
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/conda-lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,16 @@ jobs:
comment-id: ${{ github.event.comment.id }}
reactions: eyes

# Checkout the pull request branch
- name: Checkout Repository
# Checkout the git repository
- name: Checkout repository
uses: actions/checkout@v3
with:
repository: ${{ github.event.client_payload.pull_request.head.repo.full_name }}
ref: refs/pull/${{ github.event.issue.number }}/head

# Switch to pull request branch
# https://github.com/actions/checkout/issues/331#issuecomment-925405415
- name: Switch to Pull Request branch
run: hub pr checkout ${{ github.event.issue.number }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Add an emoji reaction to comment to indicate that conda-lock is starting
- name: Add reaction
Expand Down

0 comments on commit 0f280e7

Please sign in to comment.