varunsridharan / action-github-workflow-sync

Github Action To Sync Github Action's Workflow Files Across Repositories
https://github.com/marketplace/actions/github-workflow-sync
MIT License
60 stars 16 forks source link

Automatic pull requests to default branch of touched repository #5

Closed flxw closed 2 years ago

flxw commented 3 years ago

Is your feature request related to a problem? Please describe. Some of the repos we would like to keep in sync customize the workflows to a small extent. It would be nice to keep the customizability but have a common basis that is up to date.

Describe the solution you'd like It would be cool if the sync could open PRs upon pushing the workflow files to a specified branch

Describe alternatives you've considered Currently, we bypass the problem by having a workflow inside the target repo that creates the PR upon pushes to the "workflow-sync" branch

Does that make sense to you?

varunsridharan commented 3 years ago

@flxw

so what I understood is that you want this action to auto create a new pull request if any changes are found instead of pushing it directly right ?

flxw commented 3 years ago

Exactly, I think it would be useful if the changes could be pushed to a separate branch and then have a PR created towards the default branch. This way it is possible to keep customization while still having a "base in sync":

  1. Action creates new branch, pushes changes
  2. Action creates PR from new branch to default branch

It's possible with other means as I described but I think it could be a useful addition

varunsridharan commented 3 years ago

@flxw thanks for the clarification.

varunsridharan commented 3 years ago

@flxw based on your request i fully redeveloped this action from scrach .

the new version is faster compared to the current stable version and also includes 2 new features.

  1. Option to push changes as a pull request
  2. Copy file if not already exists in remote repository.

The new version is still in beta and you can give it a try by chaning the action's source branch to nodejs-fullrework

make sure to set PULL_REQUEST key to true if you want to push chages as pull request

      - name: Running Workflow Sync
        uses: varunsridharan/action-github-workflow-sync@main
        with:
+         PULL_REQUEST: true

And for the new file copy feature all you need to do is add ! before the = like below

WORKFLOW_FILES: |
  file1yml=file1.yml
  file2yml!=file2.yml 

in the above config file1.yml will get overriten every time the action is triggered for that repo. but the file file2 will only be copied once if the file not eixsts.

please do give it a try and provide your feedback.