Skip to content

Engine Snapshot

Engine Snapshot #8

name: Engine Snapshot
# Creates/updates the 'develop-engine-snapshot' branch in pipeline-ui
# with the engine submodule pointing at the given engine SHA.
# A push to that branch then triggers the Package workflow.
on:
workflow_dispatch:
inputs:
engine_sha:
description: 'Engine commit SHA (defaults to HEAD of engine develop branch)'
required: false
jobs:
update-snapshot-branch:
runs-on: ubuntu-latest
steps:
- name: Check out pipeline-ui develop
uses: actions/checkout@v4
with:
ref: develop
fetch-depth: 0
token: ${{ secrets.GH_PIPELINE_TOKEN }}
- name: Configure git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Resolve engine SHA
id: engine
run: |
SHA="${{ github.event.inputs.engine_sha }}"
if [ -z "$SHA" ]; then
SHA="$(git -C engine ls-remote origin HEAD | cut -f1)"
fi
echo "sha=$SHA" >> "$GITHUB_OUTPUT"
- name: Point engine submodule at resolved SHA
run: |
cd engine
git fetch origin
git checkout "${{ steps.engine.outputs.sha }}"
cd ..
git add engine
- name: Create or update develop-engine-snapshot branch
run: |
SHA="${{ steps.engine.outputs.sha }}"
git diff --cached --quiet || git commit -m "chore: update engine submodule to ${SHA:0:7} (engine develop)"
git commit --allow-empty -m "ci: trigger package build for engine ${SHA:0:7}"
git push origin HEAD:refs/heads/develop-engine-snapshot --force