From 65b166c4df9bdfd5d4f4aad58f776c7c51e84fac Mon Sep 17 00:00:00 2001 From: AlexNg Date: Tue, 19 Mar 2024 16:16:00 +0800 Subject: [PATCH 1/5] feat: Make PAT optional --- .github/workflows/sync-template.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sync-template.yml b/.github/workflows/sync-template.yml index eb0fe87..36926bd 100644 --- a/.github/workflows/sync-template.yml +++ b/.github/workflows/sync-template.yml @@ -37,13 +37,13 @@ jobs: with: # uncomment if you use submodules within the source repository # submodules: true - token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + token: ${{ secrets.GITHUB_TOKEN || secrets.PERSONAL_ACCESS_TOKEN }} - name: actions-template-sync uses: AndreasAugustin/actions-template-sync@v2 if: github.repository != env.UPSTREAM_REPO with: - github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + github_token: ${{ secrets.GITHUB_TOKEN || secrets.PERSONAL_ACCESS_TOKEN }} source_repo_path: ${{ env.UPSTREAM_REPO }} upstream_branch: ${{ env.UPSTREAM_BRANCH }} pr_title: "[CI] Sync with upstream template" From cb44ca5a47b98a64c77533a049a87460705caed8 Mon Sep 17 00:00:00 2001 From: AlexNg Date: Tue, 19 Mar 2024 16:37:42 +0800 Subject: [PATCH 2/5] feat: Add option to keep up-to-date or remove syncing --- setup.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/setup.sh b/setup.sh index 8da33ce..bc361cf 100755 --- a/setup.sh +++ b/setup.sh @@ -78,3 +78,26 @@ sed -i -e "s/caffeine-addictt/$username/g" .github/CODEOWNERS # Write README sed -i -e "s/Alex/$name/g" README.md + +# Optional keep up-to-date +read -p "Would you like to keep up-to-date with the template? (y/n) +=> " up_to_date + +case $up_to_date in +[Yy]*) { + echo "Writing ignore file..." + echo ".github/ISSUE_TEMPLATE/* +.github/CODEOWNERS +.github/CODESTYLE.md +.github/PULL_REQUEST_TEMPLATE.md +.github/SECURITY.md +CITATION.cff +LICENSE +README.md" >>.templatesyncignore + echo "You can view more configuration here: https://github.com/AndreasAugustin/actions-template-sync" +} ;; +*) { + echo "Removing syncing workflow..." + rm .github/workflows/sync-template.yml +} ;; +esac From 96ea8711f3eb5a064448a5224771acc408d4da10 Mon Sep 17 00:00:00 2001 From: AlexNg Date: Tue, 19 Mar 2024 16:38:30 +0800 Subject: [PATCH 3/5] feat: Add option to remove or keep setup script --- setup.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/setup.sh b/setup.sh index bc361cf..fb7ddd9 100755 --- a/setup.sh +++ b/setup.sh @@ -101,3 +101,14 @@ README.md" >>.templatesyncignore rm .github/workflows/sync-template.yml } ;; esac + +read -p "Would you like to keep this setup script? (y/n) +=> " keep_script + +case $keep_script in +[Yy]*) { + echo "Removing setup script..." + rm ./setup.sh +} ;; +*) echo "Okay." ;; +esac From 3fef731504b76831f827bb4734aadf53de583569 Mon Sep 17 00:00:00 2001 From: AlexNg Date: Tue, 19 Mar 2024 16:38:58 +0800 Subject: [PATCH 4/5] feat: echo where to report issues --- setup.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/setup.sh b/setup.sh index fb7ddd9..b3ef3cb 100755 --- a/setup.sh +++ b/setup.sh @@ -112,3 +112,7 @@ case $keep_script in } ;; *) echo "Okay." ;; esac + +echo +echo "Done! +If you encounter any issues, please report it here: https://github.com/caffeine-addictt/template/issues/new" From 521c99b371fe0d19a01dbc97779f4861424f0608 Mon Sep 17 00:00:00 2001 From: AlexNg Date: Tue, 19 Mar 2024 16:40:30 +0800 Subject: [PATCH 5/5] refactor: Use bug-report template --- setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index b3ef3cb..2873a56 100755 --- a/setup.sh +++ b/setup.sh @@ -115,4 +115,4 @@ esac echo echo "Done! -If you encounter any issues, please report it here: https://github.com/caffeine-addictt/template/issues/new" +If you encounter any issues, please report it here: https://github.com/caffeine-addictt/template/issues/new?assignees=caffeine-addictt&labels=Type%3A+Bug&projects=&template=1-bug-report.md&title=[Bug]+"