0

I'm working on GitHub actions that only get triggered by pull_request events. Wondering if there is a better "dev experience" than what I'm currently doing.

My understanding is that the workflow file must be in the base branch. So in order to test workflow changes, I gotta push code to the base branch, then trigger the workflow via the head branch.

Assume I've already got my-base and my-head branches, with a pull request set up. I trigger the workflow via syncronization events, by pushing to the head branch:

git checkout my-base
git add . && git commit -m "plx work" && git push
git checkout my-head
git merge my-base --no-edit && git push

Is there a better way?

2
  • That's not true for the trigger pull_request. It is enough for this trigger to be on the branch associated with your pull request -- no need to put it in the base branch. pull_request_target, however, needs to be in the base branch to name an example. Commented Jun 24, 2022 at 8:13
  • Yup, thats work. Thank you. Happy to accept this as an answer. Commented Jun 24, 2022 at 8:25

1 Answer 1

1

That's not true for the trigger pull_request. It is enough for this trigger to be on the branch associated with your pull request -- no need to put it in the base branch.

pull_request_target, however, needs to be in the base branch to name an example. –

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.