-
Notifications
You must be signed in to change notification settings - Fork 76
Expand file tree
/
Copy pathaction.yml
More file actions
49 lines (42 loc) · 1.67 KB
/
Copy pathaction.yml
File metadata and controls
49 lines (42 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# Copyright 2026 Democratized Data Foundation
#
# Use of this software is governed by the Business Source License
# included in the file licenses/BSL.txt.
#
# As of the Change Date specified in that file, in accordance with
# the Business Source License, use of this software will be governed
# by the Apache License, Version 2.0, included in the file
# licenses/APL.txt.
name: 'Get SourceHub Docker Image Tag'
description: 'Composite action to figure out the correct docker image to use for SourceHub'
outputs:
image:
description: "SourceHub image to use"
value: ${{ steps.image-name.outputs.image }}
runs:
# This is a composite action, setting this is required.
using: "composite"
steps:
# Uses the go.mod file to determine the version of SorceHub to be fetched for jobs
- name: Get SourceHub short commit
id: sourcehub-commit
shell: bash
run: |
SOURCEHUB_COMMIT=$(sed -rn 's/.*sourcehub.*-([0-9a-f]+)/\1/p' go.mod)
echo "short=$SOURCEHUB_COMMIT" >> "$GITHUB_ENV"
# Fetch sourcehub repo to get the full commit sha.
# note: go.mod's automatically generated placeholder version only stores the short commit.
- name: Checkout sourcehub code into the directory
uses: actions/checkout@v6
with:
repository: sourcenetwork/sourcehub
path: _sourcehub
fetch-depth: 0
- name: Build SourceHub image name
id: image-name
working-directory: _sourcehub
shell: bash
run: |
commit=$(git rev-parse $short)
echo "image=ghcr.io/sourcenetwork/sourcehub:sha-$commit" >> "$GITHUB_ENV"
echo "image=ghcr.io/sourcenetwork/sourcehub:sha-$commit" >> "$GITHUB_OUTPUT"