|
18 | 18 | with:
|
19 | 19 | fetch-depth: 0
|
20 | 20 |
|
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 |
64 | 23 |
|
65 | 24 | - name: Set up Go
|
66 | 25 | uses: actions/setup-go@v5
|
|
0 commit comments