Services: updated OS-dashboards to pre-select global tentant. #1080
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: submodules-sync | |
| on: | |
| push: | |
| branches: ['**'] | |
| tags: ['v*.*.*'] | |
| pull_request: | |
| branches: ['**'] | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| sync: | |
| name: 'Submodules Sync' | |
| runs-on: ubuntu-latest | |
| # Use the Bash shell regardless whether the GitHub Actions runner is ubuntu-latest, macos-latest, or windows-latest | |
| defaults: | |
| run: | |
| shell: bash | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| token: ${{ github.token }} | |
| submodules: recursive | |
| fetch-depth: 0 | |
| # Update references | |
| - name: Init submodules (shallow, fast) | |
| run: | | |
| git submodule update --init --recursive --depth 1 --filter=blob:none | |
| - name: Pin submodules to latest release on main (fallback to main) | |
| run: | | |
| set -euo pipefail | |
| # find submodule paths | |
| paths=$(git config -f .gitmodules --get-regexp '^submodule\..*\.path$' | awk '{print $2}') | |
| [ -z "$paths" ] && { echo "No submodules."; exit 0; } | |
| changed=0 | |
| for p in $paths; do | |
| echo "==> $p" | |
| ( | |
| cd "$p" | |
| # fetch only main and tags (shallow fetch is fine) | |
| git fetch --no-recurse-submodules --force origin \ | |
| +refs/heads/main:refs/remotes/origin/main | |
| git fetch --no-recurse-submodules --force --tags origin | |
| # pick newest semver-like tag reachable from main; else main | |
| latest=$(git tag --merged origin/main --sort=-v:refname | head -n1 || true) | |
| if [ -n "${latest:-}" ]; then | |
| echo " using tag: $latest" | |
| git checkout -q --detach "tags/$latest" | |
| else | |
| echo " no tag on main; using origin/main" | |
| git checkout -q --detach origin/main | |
| fi | |
| ) | |
| # stage the new pointer in the superproject | |
| git add "$p" && changed=1 | |
| done | |
| if [ "$changed" -eq 1 ]; then | |
| git status --porcelain | |
| else | |
| echo "No submodule pointer changes." | |
| fi | |
| - name: Commit & push (if changed) | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| set -e | |
| if ! git diff --cached --quiet; then | |
| git config user.name "Git bot" | |
| git config user.email "bot@noreply.github.com" | |
| git commit -m "Pin submodules to latest release tags (or main)" | |
| git push origin HEAD:${GITHUB_REF##refs/heads/} | |
| else | |
| echo "No changes to commit." | |
| fi |