Skip to content

Commit e35bcc7

Browse files
authored
chore: Handle build number generation on forks (#1829)
## 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) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Improved build pipeline reliability with enhanced fallback mechanisms to ensure consistent artifact generation. <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 74df938 commit e35bcc7

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

.github/workflows/build-artifacts.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
name: Build API
3333
runs-on: ubuntu-latest
3434
outputs:
35-
build_number: ${{ steps.buildnumber.outputs.build_number }}
35+
build_number: ${{ steps.buildnumber.outputs.build_number || steps.fallback_buildnumber.outputs.build_number }}
3636
defaults:
3737
run:
3838
working-directory: api
@@ -81,11 +81,18 @@ jobs:
8181
8282
- name: Generate build number
8383
id: buildnumber
84+
if: github.repository == 'unraid/api'
85+
continue-on-error: true
8486
uses: onyxmueller/build-tag-number@v1
8587
with:
8688
token: ${{ secrets.UNRAID_BOT_GITHUB_ADMIN_TOKEN || github.token }}
8789
prefix: ${{ inputs.version_override || steps.vars.outputs.PACKAGE_LOCK_VERSION }}
8890

91+
- name: Generate fallback build number
92+
id: fallback_buildnumber
93+
if: steps.buildnumber.outcome != 'success'
94+
run: echo "build_number=${GITHUB_RUN_NUMBER}" >> $GITHUB_OUTPUT
95+
8996
- name: Build
9097
run: |
9198
pnpm run build:release

0 commit comments

Comments
 (0)