Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Push fails when running from pull requests from a different user #644

Open
felds opened this issue Dec 2, 2021 · 0 comments
Open

Push fails when running from pull requests from a different user #644

felds opened this issue Dec 2, 2021 · 0 comments

Comments

@felds
Copy link

felds commented Dec 2, 2021

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:

  1. Create new a repo with user 🐮 (ex: 🐮/date-test)
  2. 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 "[email protected]"
              git config --global user.name "GitHub Action"
              git add date.txt
              git commit -m "Add date"
              git push
  3. Fork the repo from user 🐷;
  4. Make some changes, commit, and create a new PR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant