Files
ResInsight/.github/workflows/update-submodules.yml
Magne Sjaastad 10ecec9fb2 Use ubuntu-26.04 runners in all GitHub workflows
Install clang-19 from the Ubuntu archive, as apt.llvm.org has no LLVM 19 repository for 26.04.
2026-09-28 09:22:46 +02:00

45 lines
1.4 KiB
YAML

name: Update Submodules
on:
schedule:
- cron: '0 0 * * 0' # Runs every Sunday at midnight
workflow_dispatch: # Allows manual triggering of the workflow
jobs:
update-submodules:
runs-on: ubuntu-26.04
strategy:
matrix:
submodule:
- tomlplusplus
steps:
- name: Checkout repository
uses: actions/checkout@v7
with:
submodules: recursive
- name: Update submodules to latest release
id: git-change-job
run: |
cd ThirdParty/${{ matrix.submodule }}
git fetch --tags
latest_tag=$(git describe --tags `git rev-list --tags --max-count=1`)
if [ -n "$latest_tag" ]; then
git checkout $latest_tag
echo "LATEST_TAG=$latest_tag" >> "$GITHUB_OUTPUT"
else
echo "Empty tag detected in ${{ matrix.submodule }}. Nothing to do."
fi
- name: Create PR
# The generated PR does not have any tests. Close and reopen the PR to activate tests.
uses: peter-evans/create-pull-request@v8
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "Update ${{ matrix.submodule }} to ${{ steps.git-change-job.outputs.LATEST_TAG }}"
title: "Update ${{ matrix.submodule }} to ${{ steps.git-change-job.outputs.LATEST_TAG }}"
branch: ci-update-${{ matrix.submodule }}
branch-suffix: random