Change trigger branch without a code change #26645
-
Context Problem Here is our stripped down yaml:
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
You can do what you want using:
GitHub Actions: Input types for manual workflows | GitHub ChangelogGitHub Actions: Input types for manual workflows Est. reading time: 1 minute |
Beta Was this translation helpful? Give feedback.
-
Input works fine for manual workflow but I need something that will persist. i.e once the trigger branch has been changed I want it to stay like that for subsequent workflows triggered automatically.
|
Beta Was this translation helpful? Give feedback.
-
I’d probably delete the branches constraint and then have a step that runs if it’s a push and checks to see if the branch is master or a specific file exists and sets an output. And then have the rest of the workflow run only if that output is set. Then you can have the input workflow create that file on that branch and push. |
Beta Was this translation helpful? Give feedback.
-
Ahh that is exactly what I need. I added an if check in the build step and it works exactly as I need -
|
Beta Was this translation helpful? Give feedback.
I’d probably delete the branches constraint and then have a step that runs if it’s a push and checks to see if the branch is master or a specific file exists and sets an output. And then have the rest of the workflow run only if that output is set.
Then you can have the input workflow create that file on that branch and push.