From 947a99b2ca80cd993b78822dcbc80fcce01bc5a6 Mon Sep 17 00:00:00 2001 From: Bernhard Kirchen Date: Sun, 3 Mar 2024 23:16:13 +0100 Subject: [PATCH] pull requests: use a meaningful branch when building This change makes the build runner switch to a meaningful branch name, which will then appear as the "Firmware Branch" in the System Info of the web application. This helps users testing pull-request builds identify that they are actually using the changes from the respective pull request. --- .github/workflows/build.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d8a9b1f65..83f9bab23 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -60,6 +60,15 @@ jobs: - name: Get tags run: git fetch --force --tags origin + - name: Create and switch to a meaningful branch for pull-requests + if: github.event_name == 'pull_request' + run: | + OWNER=${{ github.repository_owner }} + NAME=${{ github.event.repository.name }} + ID=${{ github.event.pull_request.number }} + DATE=$(date +'%Y%m%d%H%M') + git switch -c ${OWNER}/${NAME}/pr${ID}-${DATE} + - name: Cache pip uses: actions/cache@v4 with: