Skip to content

Commit 942cdee

Browse files
WIP
1 parent 9ef4f14 commit 942cdee

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

‎.github/workflows/build-phar.yaml‎

Lines changed: 9 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
@@ -87,6 +93,7 @@ jobs:
8793
with:
8894
files: shopsys.phar
8995
tag_name: ${{ steps.release_tag.outputs.tag }}
96+
target_commitish: ${{ github.event_name == 'workflow_dispatch' && inputs.source_ref || github.ref_name }}
9097
name: ${{ steps.release_tag.outputs.tag }}
9198
prerelease: ${{ steps.release_tag.outputs.is_prerelease == 'true' }}
9299
generate_release_notes: ${{ steps.release_tag.outputs.replace_existing != 'true' }}

0 commit comments

Comments
 (0)