Skip to content

Commit cb293eb

Browse files
committed
ci(version): expose value as step output to avoid GITHUB_ENV write in the action
1 parent 928f92a commit cb293eb

3 files changed

Lines changed: 23 additions & 7 deletions

File tree

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
11
name: version
2-
description: Resolve FRANKENPHP_VERSION from the current ref (stripped tag name, with commit SHA fallback)
2+
description: Resolve the FrankenPHP version from the current ref (stripped tag name, with commit SHA fallback)
33
inputs:
44
ref:
55
description: Optional ref override (e.g. tag name resolved by a prepare job for schedule/dispatch flows)
66
required: false
77
default: ""
8+
outputs:
9+
version:
10+
description: Resolved version string
11+
value: ${{ steps.resolve.outputs.version }}
812
runs:
913
using: composite
1014
steps:
11-
- shell: bash
15+
- id: resolve
16+
shell: bash
1217
env:
1318
REF: ${{ inputs.ref }}
14-
run: | # zizmor: ignore[github-env]
19+
run: |
1520
if [ "${GITHUB_REF_TYPE}" = "tag" ]; then
1621
version="${GITHUB_REF_NAME#v}"
1722
elif [ -n "${REF}" ]; then
@@ -20,7 +25,7 @@ runs:
2025
version="${GITHUB_SHA}"
2126
fi
2227
if [[ ! "${version}" =~ ^[A-Za-z0-9._-]+$ ]]; then
23-
echo "::error::invalid FRANKENPHP_VERSION value: ${version}" >&2
28+
echo "::error::invalid version value: ${version}" >&2
2429
exit 1
2530
fi
26-
echo "FRANKENPHP_VERSION=${version}" >> "${GITHUB_ENV}"
31+
echo "version=${version}" >> "${GITHUB_OUTPUT}"

.github/workflows/static.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,9 +453,14 @@ jobs:
453453
ref: ${{ needs.prepare.outputs.ref }}
454454
persist-credentials: false
455455
- uses: ./.github/actions/setup-go
456-
- uses: ./.github/actions/version
456+
- id: version
457+
uses: ./.github/actions/version
457458
with:
458459
ref: ${{ needs.prepare.outputs.ref }}
460+
- name: Set FRANKENPHP_VERSION
461+
run: echo "FRANKENPHP_VERSION=${VERSION}" >> "${GITHUB_ENV}"
462+
env:
463+
VERSION: ${{ steps.version.outputs.version }}
459464
- name: Build FrankenPHP
460465
run: ./build-static.sh
461466
env:

.github/workflows/windows.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,15 @@ jobs:
6969
path: frankenphp
7070
persist-credentials: false
7171

72-
- uses: ./frankenphp/.github/actions/version
72+
- id: version
73+
uses: ./frankenphp/.github/actions/version
7374
with:
7475
ref: ${{ env.REF }}
76+
- name: Set FRANKENPHP_VERSION
77+
shell: bash
78+
run: echo "FRANKENPHP_VERSION=${VERSION}" >> "${GITHUB_ENV}"
79+
env:
80+
VERSION: ${{ steps.version.outputs.version }}
7581

7682
- name: Setup Go
7783
uses: ./frankenphp/.github/actions/setup-go

0 commit comments

Comments
 (0)