-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
chore(action/PR): Use pull_request_target
workflow
#92
Conversation
For PR's coming from fork repo's branch, `github.head_ref` gives a branch name which couldn't be checked out from this repo (origin). So, now we checkout the PR branch's head commit. Accordingly, changes are pushed out to fork remote too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks. minor comments only.
Use `GITHUB_OUTPUT` env. var. as recommended by GitHub
Remove checking for changes before push, as it is not necessary.
fixed. Now, another issue has emerged. Action is not able to run
This has worked in past: GitHub Action run created a commit by Did some repository security(?) settings change? Maybe Workflow permission are blocking?: ad-m/github-push-action#96 (comment) Workflow permission from my test repo, in which git push worked: |
Hm... The permissions haven't changed, and they look like they do in the screenshot you shared (rw permission). |
Does the current PR have "allow changes from maintainers" disabled? |
No, that is enabled. What I find unexpected here is that the workflow file being run is from the HEAD of this PR (since 2nd commit of this PR). No action was run on the first commit. Where I expected the use workflow file from base repo ( Maybe it is a quirk of running the PR's workflow file? (different GitHub Token?) Deno-deploy's action also pushes code commited by action bot:https://github.com/serverless-dns/serverless-dns/blob/6b9a2e9f3c043a80edbddf0665877da974052c7e/.github/workflows/deno-deploy.yml#L111-L120 |
So,
If PR is from fork:
Close enough. Different GitHub Token if PR comes from fork vs. origin. There is also |
Well, this is a bit too over the head for me (: github-actions has always been quite a bit complicated due to the nature of the scenarios it runs in... What's the course of action for us here (I'd imagine |
Actions on fork repo are disabled (default). If run on this repo, it may add unnecessary commits to the
|
Have changed the workflow to Push to fork is still broken as |
pull_request_target
workflow
pull_request_target
workflow would be correct workflow from the base repo to run on a PR.