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

Add target branch option for actions. #422

Closed
dipinknair opened this issue Mar 13, 2024 · 4 comments
Closed

Add target branch option for actions. #422

dipinknair opened this issue Mar 13, 2024 · 4 comments

Comments

@dipinknair
Copy link
Contributor

Currently some of actions uses checkout for cloning repo. For example, code-style action uses

    - name: "Install Git and clone project"
      uses: actions/checkout@v4

which takes the default main branch. Currently no option to specify for different branch where checkout action can use ref: to take input branch name.

We can possibly add one more input in actions which passes to checkout action.

This will be helpful if a scheduled ci/cd action is running and want to use feature/develop branch

@jorgepiloto
Copy link
Member

Hi @dipinknair, thanks for suggesting this.

Regarding the use case you present here, what about modifying the scheduled CI/CD action in the same branch where the feature is implemented?

@dipinknair
Copy link
Contributor Author

Hi @dipinknair, thanks for suggesting this.

Regarding the use case you present here, what about modifying the scheduled CI/CD action in the same branch where the feature is implemented?

But then the schedule action will not run in feature branch right ? CI/CD schedule action runs only on main branch. May be I am not understanding what you meant.
This is very low priority and might even not needed currently for us. I went with changing files with sed command to change files of main branch for scheduled action so that feature/develop branch is not needed.

@jorgepiloto
Copy link
Member

From the checkout action:

When checking out the repository that triggered a workflow, this defaults to the reference or SHA for that event. Otherwise, uses the default branch.

If you want to run a CI/CD on a branch because you have some changes there, just open a pull-request. If you want to avoid a PR, you can always modify the workflows in that branch to fit your needs, like using a cron job.

Let me now if this works for your situation.

@jorgepiloto
Copy link
Member

After discussing privately, we can close this issue.

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

2 participants