diff --git a/.github/workflows/build-ui.yml b/.github/workflows/build-ui.yml index cc241a4..cb3894a 100644 --- a/.github/workflows/build-ui.yml +++ b/.github/workflows/build-ui.yml @@ -38,27 +38,25 @@ jobs: working-directory: ui run: npm run build - - name: Commit changes to PR - if: github.event_name == 'pull_request' + - name: Check for changes + id: check_changes run: | - git config --global user.name 'github-actions[bot]' - git config --global user.email 'github-actions[bot]@users.noreply.github.com' git add src/ui_*.h - git status --porcelain && git commit -m "chore: update UI build outputs" && git push || echo "No changes to commit" + echo "changes=$(git status --porcelain | wc -l)" >> $GITHUB_OUTPUT - name: Create Pull Request - if: github.event_name != 'pull_request' + if: steps.check_changes.outputs.changes > '0' uses: peter-evans/create-pull-request@v7 with: commit-message: 'chore: update UI build outputs' title: 'Update UI build outputs' body: | This PR updates the UI build outputs (header files) based on changes in the UI source code. - Changes were automatically generated by the UI build workflow. - branch: update-ui-build + Original trigger: ${{ github.event_name }} ${{ github.ref }} + branch: update-ui-build-${{ github.sha }} delete-branch: true - base: master + base: ${{ github.event.pull_request.head.ref || github.ref_name }} add-paths: | src/ui_*.h labels: |