Skip to content

Commit 3efc1a8

Browse files
committed
feat(promote): set version output
1 parent 75029d5 commit 3efc1a8

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

.github/workflows/promote.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ on:
99
checkout-token:
1010
description: 'Checkout token with repo permissions'
1111
required: false
12+
outputs:
13+
version:
14+
description: 'Detected or calculated version'
15+
value: ${{ jobs.promote.outputs.version }}
16+
commit-sha:
17+
description: 'The commit SHA being built'
18+
value: ${{ jobs.promote.outputs.version }}
1219
inputs:
1320
git-user-name:
1421
description: 'The git user name'
@@ -120,6 +127,9 @@ jobs:
120127
promote:
121128
name: Promote
122129
runs-on: ubuntu-24.04
130+
outputs:
131+
version: ${{ steps.release_version.outputs.version }}
132+
commit-sha: ${{ steps.determine_sha.outputs.sha }}
123133
steps:
124134
- name: checkout repository
125135
uses: actions/checkout@v6
@@ -129,6 +139,19 @@ jobs:
129139
submodules: ${{ inputs.submodules }}
130140
token: ${{ secrets.checkout-token || secrets.GITHUB_TOKEN }}
131141

142+
- name: Determine commit SHA
143+
id: determine_sha
144+
shell: bash
145+
run: |
146+
if [ -n "${{ github.event.pull_request.head.sha }}" ]; then
147+
SHA="${{ github.event.pull_request.head.sha }}"
148+
echo "Using PR HEAD SHA: ${SHA}"
149+
else
150+
SHA=$(git rev-parse HEAD)
151+
echo "Using current HEAD SHA: ${SHA}"
152+
fi
153+
echo "sha=${SHA}" >> "$GITHUB_OUTPUT"
154+
132155
- id: release_version
133156
name: next release version
134157
uses: getdevopspro/github-actions/release-version@v6.5.1

0 commit comments

Comments
 (0)