From dc3b08df301506d44ca70fdd5697ba1377fc0055 Mon Sep 17 00:00:00 2001 From: VeithMetro Date: Tue, 3 Nov 2026 15:33:56 +0100 Subject: [PATCH] [Actions] Make Actions work automatically on all future release branches --- .../Build ThunderLibraries on Linux.yml | 8 ++++-- .github/workflows/Linux build template.yml | 28 ++++++++++++++++++- 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/.github/workflows/Build ThunderLibraries on Linux.yml b/.github/workflows/Build ThunderLibraries on Linux.yml index b8649ea..74b10df 100644 --- a/.github/workflows/Build ThunderLibraries on Linux.yml +++ b/.github/workflows/Build ThunderLibraries on Linux.yml @@ -10,9 +10,9 @@ concurrency: on: workflow_dispatch: push: - branches: ["main"] + branches: ["main", "R*"] pull_request: - branches: ["main"] + branches: ["main", "R*"] jobs: Thunder: @@ -20,4 +20,6 @@ jobs: ThunderLibraries: needs: Thunder - uses: WebPlatformForEmbedded/ThunderLibraries/.github/workflows/Linux build template.yml@main + uses: ./.github/workflows/Linux build template.yml + with: + source-repository: ${{ github.repository }} diff --git a/.github/workflows/Linux build template.yml b/.github/workflows/Linux build template.yml index 369e068..57035b3 100644 --- a/.github/workflows/Linux build template.yml +++ b/.github/workflows/Linux build template.yml @@ -5,6 +5,12 @@ permissions: on: workflow_call: + inputs: + source-repository: + description: Repository containing the ThunderLibraries source + required: false + type: string + default: WebPlatformForEmbedded/ThunderLibraries jobs: ThunderLibraries: @@ -43,11 +49,31 @@ jobs: rm ${{matrix.build_type}}/${{matrix.build_type}}${{matrix.architecture == '32' && '_x86' || ''}}.tar.gz # ----- Regex & checkout ----- + - name: Resolve release dependency branch + id: release + shell: bash + env: + BUILD_BRANCH: ${{ github.base_ref || github.ref_name }} + REF_TYPE: ${{ github.ref_type }} + run: | + release_ref= + if [[ "$REF_TYPE" == 'branch' && "$BUILD_BRANCH" == R* ]]; then + release_ref="refs/heads/$BUILD_BRANCH" + fi + echo "ref=$release_ref" >> "$GITHUB_OUTPUT" + echo "Dependency branch: ${release_ref:-repository default}" + - name: Checkout ThunderLibraries uses: actions/checkout@v5 with: path: ThunderLibraries - repository: WebPlatformForEmbedded/ThunderLibraries + repository: ${{ inputs.source-repository }} + ref: ${{ github.repository != inputs.source-repository && steps.release.outputs.ref || '' }} + + - name: Log source revisions + shell: bash + run: | + git -C ThunderLibraries log -1 --format='ThunderLibraries: %H' - name: Regex ThunderLibraries if: contains(github.event.pull_request.body, '[Options:')