File tree Expand file tree Collapse file tree 3 files changed +10
-32
lines changed Expand file tree Collapse file tree 3 files changed +10
-32
lines changed Original file line number Diff line number Diff line change
1
+ name : Auto-tag
1
2
on :
2
3
push :
3
4
tags :
8
9
runs-on : ubuntu-latest
9
10
steps :
10
11
- name : Auto-tag
11
- uses : emteknetnz/gha-auto-tag@main
12
- with :
13
- ref : ${{ github.ref }}
14
- sha : ${{ github.sha }}
12
+ uses : silverstripe/gha-auto-tag@main
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ Using the 'v' prefix to avoid confusion with the '2' branch naming convention th
14
14
15
15
## Usage
16
16
17
- .github/workflows/auto-tag.yml
17
+ ** .github/workflows/auto-tag.yml**
18
18
``` yml
19
19
on :
20
20
push :
27
27
steps :
28
28
- name : Auto-tag
29
29
uses : silverstripe/gha-auto-tag@main
30
- with :
31
- ref : ${{ github.ref }}
32
- sha : ${{ github.sha }}
33
-
34
30
` ` `
Original file line number Diff line number Diff line change 1
1
name : Auto-tag
2
2
description : Automatically delete and re-release tags so that other github action modules can use something similar to carets e.g. v0.1 or v3
3
- inputs :
4
- ref :
5
- type : string
6
- required : true
7
- description : github.ref when workflow is triggered by x.y.z semver tag e.g. refs/tags/0.1.23
8
- sha :
9
- type : string
10
- required : true
11
- description : SHA of the tag
12
3
13
4
runs :
14
5
using : composite
15
6
steps :
16
- - name : Validate inputs
7
+ - name : Validate ref
17
8
shell : bash
18
9
env :
19
- REF : ${{ inputs.ref }}
20
- SHA : ${{ inputs.sha }}
10
+ REF : ${{ github.ref }}
21
11
run : |
22
12
# refs/tags/0.1.23 => 0.1.23
23
13
TAG=$(echo $REF | cut -c 11-)
24
14
if [[ "$TAG" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
25
- echo "Valid tag $TAG"
15
+ echo "Valid semver tag $TAG"
26
16
else
27
- echo "Invalid tag $TAG"
28
- exit 1
29
- fi
30
- if [[ "$SHA" =~ ^[0-9a-f]{40}$ ]]; then
31
- echo "Valid sha $SHA"
32
- else
33
- echo "Invalid sha $SHA"
17
+ echo "Invalid semver tag $TAG"
34
18
exit 1
35
19
fi
36
20
37
21
- name : Generate tag name
38
22
id : generate_tag_name
39
23
shell : bash
40
24
env :
41
- REF : ${{ inputs .ref }}
25
+ REF : ${{ github .ref }}
42
26
run : |
43
27
# refs/tags/0.1.23 => 0.1.23
44
28
TAG=$(echo $REF | cut -c 11-)
54
38
echo "::set-output name=tag::$NEW_TAG"
55
39
56
40
- name : Add tag to repo
57
- uses : silverstripe/gha-tag-release@main
41
+ # TODO: change to silverstripe/gha-tag-release
42
+ uses : emteknetnz/gha-tag-release@main
58
43
with :
59
- sha : ${{ github.sha }}
60
44
tag : ${{ steps.generate_tag_name.outputs.tag }}
61
45
delete_existing : true
62
46
release : false
You can’t perform that action at this time.
0 commit comments