1515#
1616
1717# 🚨 GITHUB SECRETS REQUIRED:
18- # - GH_TOKEN: A GitHub token with write repo access.
19- # You can generate one from here: https://github.com/settings/tokens
20- # make sure to add it to the repo secrets with the name GH_TOKEN
21- # Attention: Not to be confused with the GITHUB_TOKEN, this is a different token with different permissions.
18+ # - NEW_TEMPLATE_VERSION_PAT: A fine-grained Personal Access Token.
19+ # This token is used to commit, push and create a new release in the template repository.
20+ # You can generate one from here: https://github.com/settings/tokens?type=beta
21+ # Set the Repository access to "Only select repositories" and select the template repository.
22+ # Set the following Repo permissions:
23+ # - Contents: Read & write (to commit, push and create a new release)
24+ # - Metadata: Read-only (mandatory by GitHub)
25+ # - Actions: Read and write (to allow triggering other workflows, like docs deployment)
26+ # Make sure to add it to the repo secrets with the name NEW_TEMPLATE_VERSION_PAT:
27+ # - Go to Repository Settings > Secrets and variables > Actions > New repository secret
28+ # - Name: NEW_TEMPLATE_VERSION_PAT
29+ # - Value: The Personal Access Token you created
2230
2331name : New Template Version
2432
@@ -45,17 +53,18 @@ jobs:
4553 permissions :
4654 contents : write
4755 steps :
48- - name : 🔍 GH_TOKEN
49- if : env.GH_TOKEN == ''
56+ - name : Check if Personal Access Token exists
5057 env :
51- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
52- run : echo "GH_TOKEN=${GITHUB_TOKEN}" >> $GITHUB_ENV
58+ PAT : ${{ secrets.NEW_TEMPLATE_VERSION_PAT }}
59+ if : env.PAT == ''
60+ run : |
61+ echo "NEW_TEMPLATE_VERSION_PAT secret not found. Please create a fine-grained Personal Access Token following the instructions in the workflow file."
62+ exit 1
5363 - name : 📦 Checkout project repo
5464 uses : actions/checkout@v3
5565 with :
5666 fetch-depth : 0
57- token : ${{ secrets.GH_TOKEN }}
58-
67+ token : ${{ secrets.NEW_TEMPLATE_VERSION_PAT }}
5968 - name : 📝 Git User Setup
6069 run : |
6170 git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
7887 tag : v${{ env.NEW_VERSION }}
7988 generateReleaseNotes : true
8089 draft : false
90+ token : ${{ secrets.NEW_TEMPLATE_VERSION_PAT }}
0 commit comments