From e35bcc72f12ef0c622b166d00c10ffc8314981c6 Mon Sep 17 00:00:00 2001 From: Eli Bosley Date: Tue, 9 Dec 2025 17:34:45 -0500 Subject: [PATCH] chore: Handle build number generation on forks (#1829) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary - guard build number generation to the main repository and allow failures without stopping the workflow - add a fallback build number derived from the GitHub run number when the tag-based number cannot be created ## Testing - not run (workflow-only change) ------ [Codex Task](https://chatgpt.com/codex/tasks/task_e_693894fb808c8323a3ee51e47fe5d772) ## Summary by CodeRabbit * **Chores** * Improved build pipeline reliability with enhanced fallback mechanisms to ensure consistent artifact generation. ✏️ Tip: You can customize this high-level summary in your review settings. --- .github/workflows/build-artifacts.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-artifacts.yml b/.github/workflows/build-artifacts.yml index d2c4414cd..2db7702ec 100644 --- a/.github/workflows/build-artifacts.yml +++ b/.github/workflows/build-artifacts.yml @@ -32,7 +32,7 @@ jobs: name: Build API runs-on: ubuntu-latest outputs: - build_number: ${{ steps.buildnumber.outputs.build_number }} + build_number: ${{ steps.buildnumber.outputs.build_number || steps.fallback_buildnumber.outputs.build_number }} defaults: run: working-directory: api @@ -81,11 +81,18 @@ jobs: - name: Generate build number id: buildnumber + if: github.repository == 'unraid/api' + continue-on-error: true uses: onyxmueller/build-tag-number@v1 with: token: ${{ secrets.UNRAID_BOT_GITHUB_ADMIN_TOKEN || github.token }} prefix: ${{ inputs.version_override || steps.vars.outputs.PACKAGE_LOCK_VERSION }} + - name: Generate fallback build number + id: fallback_buildnumber + if: steps.buildnumber.outcome != 'success' + run: echo "build_number=${GITHUB_RUN_NUMBER}" >> $GITHUB_OUTPUT + - name: Build run: | pnpm run build:release