Skip to content

Commit ce5542e

Browse files
authored
use check connector tag action from automation (#109)
1 parent 8a4561f commit ce5542e

File tree

1 file changed

+2
-43
lines changed

1 file changed

+2
-43
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -18,49 +18,8 @@ jobs:
1818
with:
1919
fetch-depth: 0
2020

21-
- name: Validate Tag Format
22-
run: |
23-
TAG=${GITHUB_REF#refs/tags/}
24-
25-
SV_REGEX="^v(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-((0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*))*))?(\+([0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*))?$"
26-
27-
if ! [[ $TAG =~ $SV_REGEX ]]; then
28-
echo "$TAG is NOT a valid tag (expected format: v<semver>)"
29-
exit 1
30-
fi
31-
32-
- name: Check Version Consistency
33-
run: |
34-
# Extract tag and remove 'v' prefix if exists
35-
TAG=${GITHUB_REF#refs/tags/}
36-
37-
# Read version from connector.yaml
38-
YAML_VERSION=$(yq e '.specification.version' connector.yaml)
39-
40-
# Compare versions
41-
if [[ "$TAG" != "$YAML_VERSION" ]]; then
42-
echo "Version mismatch detected:"
43-
echo "Git Tag: $TAG"
44-
echo "connector.yaml Version: $YAML_VERSION"
45-
exit 1
46-
fi
47-
48-
- name: Delete Invalid Tag
49-
if: failure()
50-
uses: actions/github-script@v7
51-
with:
52-
github-token: ${{secrets.GITHUB_TOKEN}}
53-
script: |
54-
const tag = context.ref.replace('refs/tags/', '')
55-
try {
56-
await github.rest.git.deleteRef({
57-
owner: context.repo.owner,
58-
repo: context.repo.repo,
59-
ref: `tags/${tag}`
60-
})
61-
} catch (error) {
62-
console.log('Error deleting tag:', error)
63-
}
21+
- name: Check Connector Tag
22+
uses: conduitio/automation/actions/check_connector_tag@main
6423

6524
- name: Set up Go
6625
uses: actions/setup-go@v5

0 commit comments

Comments
 (0)