This repository was archived by the owner on Jun 26, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (56 loc) · 2.25 KB
/
Copy pathupdate-submodule.yml
File metadata and controls
64 lines (56 loc) · 2.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Update OrchardCoreContrib.App Submodules
on:
push:
branches: [ "main" ]
jobs:
update-submodules:
name: Build windows-latest
runs-on: windows-latest
steps:
- name: Checkout OrchardCoreContrib.App
uses: actions/checkout@v6
with:
repository: OrchardCoreContrib/OrchardCoreContrib.App
submodules: true
token: ${{ secrets.OCC_TOKEN }}
- name: Update submodules
run: |
git submodule sync --recursive
git submodule update --init --recursive
git submodule update --recursive --remote
- name: Get updated submodule commit hash
id: submodule-hash
shell: pwsh
run: |
$line = (git submodule status --recursive | Select-Object -First 1).Trim()
$hash = ($line -split '\s+')[0].TrimStart('-','+')
$shortHash = $hash.Substring(0,7)
$commitUrl = "https://github.com/OrchardCoreContrib/OrchardCoreContrib.Library/commit/$hash"
"shortHash=$shortHash" >> $env:GITHUB_OUTPUT
"url=$commitUrl" >> $env:GITHUB_OUTPUT
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.OCC_TOKEN }}
commit-message: Update submodule to latest version
title: Update OrchardCoreContrib.Library submodule to latest version
body: |
Automated submodule update generated by workflow.
Commit: [`${{ steps.submodule-hash.outputs.shortHash }}`](${{ steps.submodule-hash.outputs.url }})
branch: update-submodules
delete-branch: true
base: main
labels: |
dependencies
submodule
# - name: Commit and push changes
# env:
# OCC_TOKEN: ${{ secrets.OCC_TOKEN }}
# run: |
# git config user.name "github-actions[bot]"
# git config user.email "github-actions[bot]@users.noreply.github.com"
# git add --all
# git diff --cached --quiet && exit 0
# git commit -m "Update submodules to latest versions"
# git remote set-url origin https://x-access-token:${OCC_TOKEN}@github.com/OrchardCoreContrib/OrchardCoreContrib.App.git
# git push origin HEAD:main