Skip to content

Commit

Permalink
Setup an automated PR to update downstream projects with changes (#57)
Browse files Browse the repository at this point in the history
* Add a 'template sync' github workflow

Signed-off-by: Fabrice Normandin <[email protected]>

* Remove cruft-update workflow for now

Signed-off-by: Fabrice Normandin <[email protected]>

---------

Signed-off-by: Fabrice Normandin <[email protected]>
  • Loading branch information
lebrice authored Oct 3, 2024
1 parent 52c88ce commit 4696cd2
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/template-sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Action based on https://github.com/AndreasAugustin/actions-template-sync
name: Update repository with changes from the template
on:
# cronjob trigger
schedule:
- cron: "0 0 1 * *" # on the first of every month
# manual trigger
workflow_dispatch:

# https://0xdc.me/blog/github-templates-and-repository-sync/
env:
SOURCE_BRANCH: master
SOURCE_REPOSITORY: mila-iqia/ResearchTemplate

jobs:
repo-sync:
runs-on: ubuntu-latest
# https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
permissions:
contents: write
pull-requests: write

steps:
# To use this repository's private action, you must check out the repository
- name: Checkout ${{ github.repository }}
uses: actions/checkout@v4
if: github.repository != env.SOURCE_REPOSITORY
# 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
if: github.repository != env.SOURCE_REPOSITORY
with:
source_repo_path: mila-iqia/ResearchTemplate
upstream_branch: master # defaults to main
pr_labels: template_sync # defaults to template_sync
pr_title: "Add new features from the template repository"
pr_body: "This is an automated PR to update the repository with changes from the template."
2 changes: 2 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
site_name: Research Project Template
site_description: Template for a ML Research project.
# TODO: Need to make sure that the repo URL and site URL are updated correctly in downstream
# projects, otherwise they will either get a 403 error, or change the docs of the template!
site_url: https://mila-iqia.github.io/ResearchTemplate/
repo_url: https://www.github.com/mila-iqia/ResearchTemplate
# edit_uri: edit/master/docs
Expand Down

0 comments on commit 4696cd2

Please sign in to comment.