Skip to content

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

@lestephane

Description

@lestephane

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.

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions