Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ jobs:

Create a `.templatesyncignore` file. Just like writing a `.gitignore` file, follow the [glob pattern](https://en.wikipedia.org/wiki/Glob_(programming)) in defining the files and folders that should be excluded from syncing with the template repository.

_Note: It is not possible to sync also the `.templatesyncignore` itself. Any changes from the template repository will be restored automatically._

## Debug

You must create a secret named `ACTIONS_STEP_DEBUG` with the value `true` to see the debug messages set by this command in the log. For more information, see "[Enabling debug logging.][enabling-debug-logging]"
Expand Down
8 changes: 8 additions & 0 deletions src/sync_template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ echo "::debug::pull changes from template"
git pull "${SOURCE_REPO}" --allow-unrelated-histories --squash --strategy=recursive -X theirs
echo "::endgroup::"

if [ -s ${TEMPLATE_SYNC_IGNORE_FILE_NAME} ]
then
echo "::group::restore ignore file"
git reset ${TEMPLATE_SYNC_IGNORE_FILE_NAME}
git checkout -- ${TEMPLATE_SYNC_IGNORE_FILE_NAME}
echo "::endgroup::"
fi

echo "::group::persist template version"
echo "write new template version file"
echo "${NEW_TEMPLATE_GIT_HASH}" > ${TEMPLATE_VERSION_FILE_NAME}
Expand Down