Skip to content

Commit 4b3c3ba

Browse files
WIP
1 parent 9ef4f14 commit 4b3c3ba

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

.github/workflows/build-phar.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ on:
88
- 'v*'
99
workflow_dispatch:
1010
inputs:
11+
source_ref:
12+
description: 'Branch, tag, or SHA to build'
13+
required: true
14+
type: string
1115
release_tag:
1216
description: 'Release tag name (e.g., v1.0.0)'
1317
required: true
@@ -22,6 +26,8 @@ jobs:
2226
steps:
2327
- name: Checkout code
2428
uses: actions/checkout@v4
29+
with:
30+
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.source_ref || github.ref }}
2531

2632
- name: Setup PHP
2733
uses: shivammathur/setup-php@v2
@@ -60,9 +66,9 @@ jobs:
6066

6167
- name: Add build metadata
6268
run: |
63-
echo "BUILD_SHA=${{ github.sha }}" >> .build-metadata
69+
echo "BUILD_SHA=$(git rev-parse HEAD)" >> .build-metadata
6470
echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> .build-metadata
65-
echo "BUILD_REF=${{ steps.release_tag.outputs.tag }}" >> .build-metadata
71+
echo "BUILD_REF=${{ github.event_name == 'workflow_dispatch' && inputs.source_ref || github.ref_name }}" >> .build-metadata
6672
6773
- name: Set CLI version in box.json
6874
run: sed -i 's/\$CLI_VERSION/${{ steps.release_tag.outputs.tag }}/' box.json

0 commit comments

Comments
 (0)