forked from temporalio/temporal
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (48 loc) · 1.85 KB
/
check-release-dependencies.yml
File metadata and controls
59 lines (48 loc) · 1.85 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
50
51
52
53
54
55
56
57
58
59
name: Check Release Dependencies
on:
pull_request: {}
permissions:
contents: read
jobs:
check-dependencies:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
if: >-
startsWith('release/', github.event.pull_request.base.ref) ||
startsWith('cloud/', github.event.pull_request.base.ref)
- name: Check temporal dependencies use tagged versions
if: >-
startsWith('release/', github.event.pull_request.base.ref) ||
startsWith('cloud/', github.event.pull_request.base.ref)
run: |
echo "Checking that temporal dependencies use tagged versions..."
# Semantic version regex pattern (e.g., v1.2.3)
SEMVER_PATTERN="^v[0-9]+\.[0-9]+\.[0-9]+$"
DEPENDENCIES=(
"go.temporal.io/api"
"go.temporal.io/sdk"
)
ERRORS=""
for DEPENDENCY in "${DEPENDENCIES[@]}"; do
VERSION=$(grep "^[[:space:]]*$DEPENDENCY" go.mod | awk '{print $2}')
if [ -z "$VERSION" ]; then
echo "Error: $DEPENDENCY dependency not found in go.mod"
exit 1
fi
if ! echo "$VERSION" | grep -qE "$SEMVER_PATTERN"; then
ERRORS="${ERRORS} $DEPENDENCY version '$VERSION' is not using a tagged version\n"
fi
done
if [ -n "$ERRORS" ]; then
echo "Dependency version check failed:"
echo -e "$ERRORS"
echo ""
echo "For release branches, temporal dependencies must point to tagged"
echo "versions (e.g., v1.2.3) rather than specific commits."
echo ""
echo "Please update your go.mod file to use proper semantic version tags."
exit 1
fi
echo "All temporal dependencies are using tagged versions"