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" diff --git a/setup.sh b/setup.sh index 8da33ce..2873a56 100755 --- a/setup.sh +++ b/setup.sh @@ -78,3 +78,41 @@ 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 + +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 + +echo +echo "Done! +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]+"