Skip to content

Commit

Permalink
updates to the sync-template action (#159)
Browse files Browse the repository at this point in the history
* fix errors
* update .templatesyncignore
* add note to readme about tokens
* add force deletion true to catch deleted files
  • Loading branch information
JessicaS11 authored Mar 28, 2024
1 parent e4576db commit d33090f
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 15 deletions.
3 changes: 3 additions & 0 deletions .github/actions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ Open a PR to update the templated repo to incorporate changes made to the
[template repo](https://github.com/uwhackweek/jupyterbook-template).
Template users should fill out the [.templatesyncignore](../../../.templatesyncignore)
to specify which files they do not want updated from the template.
Note that if you want the GitHub action and workflow files to be updated,
you will need to [create a personal access token(PAT)](https://github.com/AndreasAugustin/actions-template-sync?tab=readme-ov-file#troubleshooting).
Alternatively, you must add ".github/**" to your `.templatesyncignore` file, and your actions will not be updated.


## Security
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/template-sync.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: 'Sync to Template'
description: 'Get updates to the Jupyterbook from the template repo'

on:
# cronjob trigger (minute, hour, day, month, day-of-week; here 1st of month)
Expand All @@ -20,14 +19,15 @@ jobs:
# To use this repository's private action, you must check out the repository
- name: Checkout
uses: actions/checkout@v4
# https://github.com/actions/checkout#usage
# uncomment if you use submodules within the source repository
# with:
# submodules: true
# comment token (and add .github path to .templatesyncignore)
# if you do not want actions and workflows updated
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: actions-template-sync
uses: AndreasAugustin/actions-template-sync@v1
uses: AndreasAugustin/actions-template-sync@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
source_repo_path: uwhackweek/jupyterbook-template
upstream_branch: main # defaults to main
upstream_branch: main # defaults to main
is_force_deletion: True
16 changes: 9 additions & 7 deletions .templatesyncignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
# THIS FILE CANNOT BE SYNCED
# use glob patterns as in .gitignore
# recommend listing non-basics tutorial directories here

###
# configuration files
cookiecutter.yaml

###
# environment lock files
./conda/*lock.yml

conda/*lock.yml
###
# team member files
team/*-*
###
# book files (configuration, usage-specific)
./book/_config.yml
./book/team.yaml

book/_config.yml
###
# event-specific tutorials
2 changes: 1 addition & 1 deletion team/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Follow these steps to add yourself:
* Use the provided 'template.yaml' file and copy the file.
* Create a copy of the 'template.yaml' file and rename the file to your name
```
cp template.yaml FirstName_LastName.yaml
cp template.yaml FirstName-LastName.yaml
```
* Open the new file you just created in your favorite editor and fill out the
details, replacing the placeholder text.
Expand Down

0 comments on commit d33090f

Please sign in to comment.