Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/template-sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Template Sync
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where do we specify which files should be kept in sync?

Take the readme file for instance. A new repo using the template repo should modify the readme for its own needs. If the readme template in the template repo gets updated, it is not clear how the readme in the new repo should be synchronized...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bydefault it sync all file in template repo except in .github/workflows one due to github policy

for that i have also created a issue:#76
even if you want to ignore a file mention it specially

Image

Once the workflow is triggered, it will compare the target repository with the source, and will open a Pull Request on the target repository if there are any differences You can see how it looks like in the Pull Requests #1 and #2 from dotdc/terraform-module-example.

have a look on : https://github.com/AndreasAugustin/actions-template-sync?tab=readme-ov-file#ignore-files

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then let's already add .templatesyncignore file to the template repo, to make it ignore files like README.md, which are supposed to be customized in the destination repo and then not overwritten/synced by the tempalte repo again.


on:
# cronjob trigger - runs monthly on the 1st at midnight
schedule:
- cron: "0 0 1 * *"
workflow_dispatch:
jobs:
repo-sync:
runs-on: ubuntu-latest
if: github.repository != 'AOSSIE-Org/Template-Repo'
# https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
permissions:
contents: write
pull-requests: write

steps:
# Check out the repository
- name: Checkout
uses: actions/checkout@v4
# https://github.com/actions/checkout#usage
# uncomment if you use submodules within the repository
# with:
# submodules: true

- name: actions-template-sync
uses: AndreasAugustin/actions-template-sync@v2
with:
source_repo_path: AOSSIE-Org/Template-Repo
upstream_branch: main # defaults to main
pr_labels: template_sync,auto_pr # defaults to template_sync
source_gh_token: ${{ secrets.GITHUB_TOKEN }}
is_pr_cleanup: true # for not open multiple PRs
Loading