Skip to content

Commit

Permalink
Merge pull request #16 from caffeine-addictt/feature/optional-pat
Browse files Browse the repository at this point in the history
[Feature] Making PAT optional and adding stuff to setup script
  • Loading branch information
caffeine-addictt authored Mar 19, 2024
2 parents 705a679 + 521c99b commit ced9872
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 2 deletions.
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]+"

0 comments on commit ced9872

Please sign in to comment.