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 support for $default-branch placeholder expansion (to copy workflows from <ORG>/.github/workflow-templates) #20

Open
lestephane opened this issue Jul 20, 2022 · 1 comment
Assignees

Comments

@lestephane
Copy link

Is your feature request related to a problem? Please describe.

I started my journey towards workflow sharing with starter workflows at https://docs.github.com/en/actions/using-workflows/creating-starter-workflows-for-your-organization, by creating files in the org .github repo's workflow-templates sub-directorywith the $default-branch placeholder.

Then later, I realized I can't use workflow-templates unless I switch to GitHub Enterprise Cloud. Which I'm not ready to do (yet).
And I only have private repos in my organization.

Then I found this project, and figured this would solve my immediate problem of copying workflow files to target repositories whenever a change is pushed.

Problem: The target repositories use a mix of master and main as default branch. And I cannot change that yet.

Describe the solution you'd like
Have action-github-workflow-sync replace $default-branch with the default branch name of the repository that the workflow file is being copied to. This way, I keep workflow-templates which is starter workflow friendly for the day I switch to Enterprise Cloud (which could be never), and yet the sync creates a workflow file that contains the correct default branch name on my behalf.

There is then only one source of truth for the workflows...

Describe alternatives you've considered
I've considered reusable workflows, but it is not possible to call a reusable workflow in a private repository from a workflow in another private repository.

Additional context
Organizations dealing only with private repositories are not well served by default when it comes to keeping workflows DRY. Making this change could help improve the situation.

@lestephane lestephane changed the title add support for $default-branch placeholder expansion (to copy workflows from org/.github/workflow-templates) add support for $default-branch placeholder expansion (to copy workflows from <ORG>/.github/workflow-templates) Jul 20, 2022
@varunsridharan varunsridharan self-assigned this Jul 20, 2022
@varunsridharan
Copy link
Owner

@lestephane

What i understood from your solution is that you want this action to auto find & replace $default-branch text inside the copied workflow file and update it with the proper branch name of the target repository

Is that right ?

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