|
| 1 | +# Copyright 2026 Democratized Data Foundation |
| 2 | +# |
| 3 | +# Use of this software is governed by the Business Source License |
| 4 | +# included in the file licenses/BSL.txt. |
| 5 | +# |
| 6 | +# As of the Change Date specified in that file, in accordance with |
| 7 | +# the Business Source License, use of this software will be governed |
| 8 | +# by the Apache License, Version 2.0, included in the file |
| 9 | +# licenses/APL.txt. |
| 10 | + |
| 11 | +name: 'Get Vera Docker Image Tag' |
| 12 | + |
| 13 | +description: 'Composite action to determine the Vera Docker image matching go.mod' |
| 14 | + |
| 15 | +outputs: |
| 16 | + image: |
| 17 | + description: "Vera image to use" |
| 18 | + value: ${{ steps.image-name.outputs.image }} |
| 19 | + |
| 20 | +runs: |
| 21 | + # This is a composite action, setting this is required. |
| 22 | + using: "composite" |
| 23 | + |
| 24 | + steps: |
| 25 | + # Go pseudo-versions contain the short commit for the required Vera revision. |
| 26 | + - name: Get Vera short commit |
| 27 | + id: vera-commit |
| 28 | + shell: bash |
| 29 | + run: | |
| 30 | + set -euo pipefail |
| 31 | + VERA_COMMIT=$(sed -En \ |
| 32 | + 's|^[[:space:]]*github.com/sourcenetwork/vera[[:space:]]+v[^[:space:]]+-([0-9a-f]+)[[:space:]]*$|\1|p' \ |
| 33 | + go.mod) |
| 34 | + test -n "$VERA_COMMIT" |
| 35 | + echo "short=$VERA_COMMIT" >> "$GITHUB_OUTPUT" |
| 36 | +
|
| 37 | + # Fetch Vera to resolve the short pseudo-version commit to its full SHA. |
| 38 | + - name: Checkout Vera code into the directory |
| 39 | + uses: actions/checkout@v6 |
| 40 | + with: |
| 41 | + repository: sourcenetwork/vera |
| 42 | + path: _vera |
| 43 | + fetch-depth: 0 |
| 44 | + |
| 45 | + - name: Build Vera image name |
| 46 | + id: image-name |
| 47 | + working-directory: _vera |
| 48 | + shell: bash |
| 49 | + run: | |
| 50 | + commit=$(git rev-parse "${{ steps.vera-commit.outputs.short }}^{commit}") |
| 51 | + echo "image=ghcr.io/sourcenetwork/vera:sha-$commit" >> "$GITHUB_OUTPUT" |
0 commit comments