File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010jobs :
1111 which-dotnet :
1212 runs-on : ubuntu-latest
13+ env :
14+ PR_TOKEN : ${{ secrets.DEVLOOPED_TOKEN || secrets.GH_TOKEN }}
1315 permissions :
1416 contents : write
1517 pull-requests : write
@@ -20,18 +22,19 @@ jobs:
2022 with :
2123 name : ${{ secrets.BOT_NAME }}
2224 email : ${{ secrets.BOT_EMAIL }}
23- gh_token : ${{ secrets.GH_TOKEN }}
25+ gh_token : ${{ env.PR_TOKEN }}
2426 github_token : ${{ secrets.GITHUB_TOKEN }}
2527
2628 - name : 🤘 checkout
2729 uses : actions/checkout@v4
2830 with :
29- token : ${{ env.GH_TOKEN }}
31+ token : ${{ env.PR_TOKEN || github.token }}
3032
3133 - name : 🤌 dotnet
3234 uses : devlooped/actions-which-dotnet@v1
3335
3436 - name : ✍ pull request
37+ if : env.PR_TOKEN != ''
3538 uses : peter-evans/create-pull-request@v7
3639 with :
3740 base : main
4144 title : " ⚙ Update dotnet versions"
4245 body : " Update dotnet versions"
4346 commit-message : " Update dotnet versions"
44- token : ${{ env.GH_TOKEN }}
47+ token : ${{ env.PR_TOKEN }}
48+
49+ - name : ⚠️ skip pull request
50+ if : env.PR_TOKEN == ''
51+ shell : bash
52+ run : echo "::warning::Skipping PR creation because neither DEVLOOPED_TOKEN nor GH_TOKEN is configured. GITHUB_TOKEN cannot create pull requests in this repository."
Original file line number Diff line number Diff line change 1212jobs :
1313 includes :
1414 runs-on : ubuntu-latest
15+ env :
16+ PR_TOKEN : ${{ secrets.DEVLOOPED_TOKEN || secrets.GH_TOKEN }}
1517 permissions :
1618 contents : write
1719 pull-requests : write
@@ -21,13 +23,13 @@ jobs:
2123 with :
2224 name : ${{ secrets.BOT_NAME }}
2325 email : ${{ secrets.BOT_EMAIL }}
24- gh_token : ${{ secrets.GH_TOKEN }}
26+ gh_token : ${{ env.PR_TOKEN }}
2527 github_token : ${{ secrets.GITHUB_TOKEN }}
2628
2729 - name : 🤘 checkout
2830 uses : actions/checkout@v4
2931 with :
30- token : ${{ env.GH_TOKEN }}
32+ token : ${{ env.PR_TOKEN || github.token }}
3133
3234 - name : +Mᐁ includes
3335 uses : devlooped/actions-includes@v1
5052 ((get-content -raw $file) -replace '\$product\$',$product).trim() | set-content $file
5153
5254 - name : ✍ pull request
55+ if : env.PR_TOKEN != ''
5356 uses : peter-evans/create-pull-request@v8
5457 with :
5558 add-paths : |
6467 commit-message : +Mᐁ includes
6568 title : +Mᐁ includes
6669 body : +Mᐁ includes
67- token : ${{ env.GH_TOKEN }}
70+ token : ${{ env.PR_TOKEN }}
71+
72+ - name : ⚠️ skip pull request
73+ if : env.PR_TOKEN == ''
74+ shell : bash
75+ run : echo "::warning::Skipping PR creation because neither DEVLOOPED_TOKEN nor GH_TOKEN is configured. GITHUB_TOKEN cannot create pull requests in this repository."
You can’t perform that action at this time.
0 commit comments