Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Making PAT optional and adding stuff to setup script #16

Merged
merged 5 commits into from
Mar 19, 2024
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
4 changes: 2 additions & 2 deletions .github/workflows/sync-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
38 changes: 38 additions & 0 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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]+"