Skip to content
This repository was archived by the owner on Jun 26, 2026. It is now read-only.

Commit 9ccf04f

Browse files
Copilothishamco
andauthored
Fix submodule workflow authentication
- Replace PERSONAL_ACCESS_TOKEN with SUBMODULE_TOKEN - Add token validation step with clear error message - Add permissions: contents: read - Add git submodule sync --recursive before updating submodules Agent-Logs-Url: https://github.com/OrchardCoreContrib/OrchardCoreContrib.Library/sessions/7cf41004-b52b-4a4a-8b3e-371dd79e1fd1 Co-authored-by: hishamco <3237266+hishamco@users.noreply.github.com>
1 parent 2353686 commit 9ccf04f

1 file changed

Lines changed: 16 additions & 3 deletions

File tree

.github/workflows/update-submodule.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,44 @@ on:
55
push:
66
branches: [ "main" ]
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
update-submodules:
1013
runs-on: ubuntu-latest
1114

1215
steps:
16+
- name: Validate token
17+
env:
18+
SUBMODULE_TOKEN: ${{ secrets.SUBMODULE_TOKEN }}
19+
run: |
20+
if [ -z "$SUBMODULE_TOKEN" ]; then
21+
echo "::error::Missing SUBMODULE_TOKEN secret. Add a PAT with access to OrchardCoreContrib/OrchardCoreContrib.App."
22+
exit 1
23+
fi
24+
1325
- name: Checkout OrchardCoreContrib.App
1426
uses: actions/checkout@v6
1527
with:
1628
repository: OrchardCoreContrib/OrchardCoreContrib.App
17-
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
29+
token: ${{ secrets.SUBMODULE_TOKEN }}
1830
submodules: true
1931

2032
- name: Update submodules
2133
run: |
34+
git submodule sync --recursive
2235
git submodule update --init --recursive
2336
git submodule update --recursive --remote
2437
2538
- name: Commit and push changes
2639
env:
27-
TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
40+
SUBMODULE_TOKEN: ${{ secrets.SUBMODULE_TOKEN }}
2841
run: |
2942
git config user.name "github-actions[bot]"
3043
git config user.email "github-actions[bot]@users.noreply.github.com"
3144
git add --all
3245
git diff --cached --quiet && exit 0
3346
git commit -m "Update submodules"
34-
git remote set-url origin https://x-access-token:${TOKEN}@github.com/OrchardCoreContrib/OrchardCoreContrib.App.git
47+
git remote set-url origin https://x-access-token:${SUBMODULE_TOKEN}@github.com/OrchardCoreContrib/OrchardCoreContrib.App.git
3548
git push origin HEAD:main

0 commit comments

Comments
 (0)