Skip to content

Commit

Permalink
pull requests: use a meaningful branch when building
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
schlimmchen committed Mar 5, 2024
1 parent 78e70cc commit 947a99b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 947a99b

Please sign in to comment.