Push fails when running from pull requests from a different user
Open
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 8.9k
- Forks
- 2.8k
- PR merge metrics
- No merged PRs in 30d
Description
Although committing and pushing from the same account is possible with v2, whenever the workflow is running from a pull request made by a different user, the HEAD comes as detached and pushing back is not possible.
Steps to reproduce:
- Create new a repo with user 🐮 (ex:
🐮/date-test) - Add the following workflow to the repo:
on: [pull_request] jobs: add_date: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v2 with: fetch-depth: 0 - name: Add date run: date > date.txt - name: Push it run: | git config --global user.email "actions@github.com" git config --global user.name "GitHub Action" git add date.txt git commit -m "Add date" git push - Fork the repo from user 🐷;
- Make some changes, commit, and create a new PR.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with the provided actions/checkout@v2 workflow, especially the pull request from a fork and its detached HEAD state. Trace the checkout action's pull-request handling and verify the expected behavior by confirming whether the workflow can commit and push date.txt back to the appropriate branch.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions, typescript
- Domain
- ci-cd, devops
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100