Skip to content

Commit ed22be4

Browse files
authored
Merge branch 'master' into node-22
2 parents 0f0b5e0 + 3c000b6 commit ed22be4

File tree

3 files changed

+68
-1
lines changed

3 files changed

+68
-1
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @cloudnode-pro/development

.github/workflows/major.yaml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Tag Major Version
2+
3+
on:
4+
push:
5+
tags: [v*.*.*]
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
update-major-version-tag:
12+
name: Update major version tag
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
18+
- name: Get major version
19+
id: major-version
20+
run: |
21+
VERSION=${GITHUB_REF#refs/tags/}
22+
MAJOR=${VERSION%%.*}
23+
echo "sha=$(git rev-list -n 1 $VERSION)" >> $GITHUB_OUTPUT
24+
echo "major=$MAJOR" >> $GITHUB_OUTPUT
25+
26+
- name: Find major tag
27+
id: major-tag
28+
uses: actions/github-script@v7
29+
with:
30+
result-encoding: string
31+
script: |
32+
try {
33+
await github.rest.git.getRef({
34+
...context.repo,
35+
ref: "tags/${{ steps.major-version.outputs.major }}"
36+
});
37+
return "1";
38+
}
39+
catch (err) {
40+
if (err.status === 404)
41+
return "0";
42+
throw err;
43+
}
44+
45+
- name: Create major version tag
46+
if: steps.major-tag.outputs.result == '0'
47+
uses: actions/github-script@v7
48+
with:
49+
script: |
50+
github.rest.git.createRef({
51+
...context.repo,
52+
ref: "refs/tags/${{ steps.major-version.outputs.major }}",
53+
sha: "${{ steps.major-version.outputs.sha }}"
54+
})
55+
56+
- name: Move major version tag
57+
if: steps.major-tag.outputs.result == '1'
58+
uses: actions/github-script@v7
59+
with:
60+
script: |
61+
github.rest.git.updateRef({
62+
...context.repo,
63+
ref: "tags/${{ steps.major-version.outputs.major }}",
64+
sha: "${{ steps.major-version.outputs.sha }}",
65+
force: true
66+
})

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
steps:
1616
#
1717
- name: Upload to release
18-
uses: cloudnode-pro/release-upload-asset@1.0.2
18+
uses: cloudnode-pro/release-upload-asset@v1
1919
with:
2020
# See the ‘Inputs’ section below for details.
2121
gh-token: ${{ github.token }}

0 commit comments

Comments
 (0)