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

Change the committer and author #29

Change the committer and author

Change the committer and author #29

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: Capture current submodule commit hash
id: submodule-old
shell: pwsh
run: |
$line = (git submodule status --recursive | Select-Object -First 1).Trim()
$parts = $line -split '\s+'
$hash = $parts[0].TrimStart('-','+')
$path = $parts[1]
"hash=$hash" >> $env:GITHUB_OUTPUT
"path=$path" >> $env:GITHUB_OUTPUT
- name: Update submodules
run: |
git submodule sync --recursive
git submodule update --init --recursive
git submodule update --recursive --remote
- name: Capture updated submodule details
id: submodule-new
shell: pwsh
env:
OLD_HASH: ${{ steps.submodule-old.outputs.hash }}
SUBMODULE_PATH: ${{ steps.submodule-old.outputs.path }}
run: |
$line = (git submodule status --recursive | Select-Object -First 1).Trim()
$newHash = ($line -split '\s+')[0].TrimStart('-','+')
$repoUrl = (git -C $env:SUBMODULE_PATH config --get remote.origin.url).Trim()
if ($repoUrl -match '^git@github\.com:(.+)\.git$') {
$repoUrl = "https://github.com/$($Matches[1])"
} else {
$repoUrl = $repoUrl -replace '\.git$',''
}
$repoName = $repoUrl.Split('/')[-1]
$oldShort = $env:OLD_HASH.Substring(0,7)
$newShort = $newHash.Substring(0,7)
"repoUrl=$repoUrl" >> $env:GITHUB_OUTPUT
"repoName=$repoName" >> $env:GITHUB_OUTPUT
"oldHash=$($env:OLD_HASH)" >> $env:GITHUB_OUTPUT
"newHash=$newHash" >> $env:GITHUB_OUTPUT
"oldShort=$oldShort" >> $env:GITHUB_OUTPUT
"newShort=$newShort" >> $env:GITHUB_OUTPUT
"oldCommitUrl=$repoUrl/commit/$($env:OLD_HASH)" >> $env:GITHUB_OUTPUT
"newCommitUrl=$repoUrl/commit/$newHash" >> $env:GITHUB_OUTPUT
"compareUrl=$repoUrl/compare/$($env:OLD_HASH)...$newHash" >> $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
committer: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
author: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
title: Update OrchardCoreContrib.Library Submodule Version
body: |
Updated [${{ steps.submodule-new.outputs.repoName }}](${{ steps.submodule-new.outputs.repoUrl }}) from ${{ steps.submodule-new.outputs.oldShort }} to ${{ steps.submodule-new.outputs.newShort }}.
<details>
<summary>Details</summary>
_This automated submodule update was generated by workflow._
- Old commit: [${{ steps.submodule-new.outputs.oldShort }}](${{ steps.submodule-new.outputs.oldCommitUrl }})
- New commit: [${{ steps.submodule-new.outputs.newShort }}](${{ steps.submodule-new.outputs.newCommitUrl }})
[View changes](${{ steps.submodule-new.outputs.compareUrl }})
</details>
branch: update-submodule
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