Skip to content

Commit 88f565a

Browse files
committed
[FEATURE] Output checked out sha & ref of schema repo used
Signed-off-by: John McCall <john@overturemaps.org>
1 parent b981ef7 commit 88f565a

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

.github/actions/generate-schema-docs/action.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,35 @@ inputs:
2121
required: false
2222
default: 'false'
2323

24+
outputs:
25+
schema-sha:
26+
description: 'The exact commit SHA of the OvertureMaps/schema repo that was checked out'
27+
value: ${{ steps.get-sha.outputs.commit || steps.get-sha-fallback.outputs.sha }}
28+
schema-ref:
29+
description: 'The ref (branch/tag/SHA) of the OvertureMaps/schema repo that was checked out'
30+
value: ${{ steps.get-sha.outputs.ref || steps.get-sha-fallback.outputs.ref }}
31+
2432
runs:
2533
using: composite
2634
steps:
2735
- name: Check out schema repo
36+
id: get-sha
2837
if: inputs.skip-checkout == 'false'
2938
uses: actions/checkout@v6
3039
with:
3140
repository: OvertureMaps/schema
3241
ref: ${{ inputs.schema-ref }}
3342
path: ${{ inputs.schema-path }}
3443

44+
- name: Resolve schema SHA (skip-checkout true)
45+
id: get-sha-fallback
46+
if: inputs.skip-checkout == 'true'
47+
shell: bash
48+
working-directory: ${{ inputs.schema-path }}
49+
run: |
50+
echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
51+
echo "ref=$(git symbolic-ref --short HEAD 2>/dev/null || git rev-parse HEAD)" >> $GITHUB_OUTPUT
52+
3553
- name: Set up Python
3654
uses: actions/setup-python@v6
3755
with:

0 commit comments

Comments
 (0)