1
- on : push
1
+ # ------------------------------------------------------- #
2
+ # Note: this file originates in template-action-composite #
3
+ # ------------------------------------------------------- #
4
+
5
+ on :
6
+ - push
7
+ - workflow_dispatch
2
8
3
9
name : push
4
10
5
11
jobs :
12
+ metadata :
13
+ runs-on : ubuntu-latest
14
+
15
+ outputs :
16
+ repository : ${{ steps.metadata.outputs.repository }}
17
+
18
+ steps :
19
+
20
+
21
+ - uses : ahmadnassri/action-metadata@v1
22
+ id : metadata
23
+
6
24
commit-lint :
7
25
timeout-minutes : 5
8
26
9
27
runs-on : ubuntu-latest
10
28
11
29
steps :
12
- - uses : actions/checkout@v2.3.5
30
+ - uses : actions/checkout@v3.0.2
13
31
14
32
- uses : ahmadnassri/action-commit-lint@v1
15
33
with :
@@ -21,24 +39,28 @@ jobs:
21
39
runs-on : ubuntu-latest
22
40
23
41
steps :
24
- - uses : actions/checkout@v2.3.5
42
+ - uses : actions/checkout@v3.0.2
25
43
with :
26
44
fetch-depth : 0
27
45
28
- - uses : github/super-linter@v3.17.1
46
+ - uses : github/super-linter/slim@v4
29
47
env :
30
48
LOG_LEVEL : ERROR
31
- VALIDATE_ALL_CODEBASE : false
49
+ VALIDATE_ALL_CODEBASE : ' false'
50
+ IGNORE_GITIGNORED_FILES : ' true'
32
51
FILTER_REGEX_EXCLUDE : ' /github/workspace/README.md|test/fixtures/*'
33
52
GITHUB_TOKEN : ${{ github.token }}
34
53
35
54
release :
55
+ timeout-minutes : 5
56
+
36
57
needs :
58
+ - metadata
37
59
- commit-lint
38
60
- super-linter
39
61
40
- # only runs on main branch
41
- if : ${{ github.ref == 'refs/heads/master' }}
62
+ # only runs on main branch for non template repos
63
+ if : ${{ github.ref == 'refs/heads/master' && !fromJSON(needs.metadata.outputs.repository).is_template }}
42
64
43
65
runs-on : ubuntu-latest
44
66
@@ -49,18 +71,18 @@ jobs:
49
71
release-version-minor : ${{ steps.release.outputs.release-version-minor }}
50
72
51
73
steps :
52
- - uses : actions/checkout@v2.3.5
74
+ - uses : actions/checkout@v3.0.2
53
75
- id : release
54
- uses : ahmadnassri/action-semantic-release@v1
76
+ uses : ahmadnassri/action-semantic-release@v2
55
77
with :
56
78
config : ${{ github.workspace }}/.semantic.json
57
79
env :
58
- GITHUB_TOKEN : ${{ github.token }}
80
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
59
81
60
82
alias :
61
83
needs : release
62
84
63
- if : needs.release.outputs.published == 'true'
85
+ if : ${{ needs.release.outputs.published == 'true' }}
64
86
65
87
runs-on : ubuntu-latest
66
88
strategy :
@@ -70,14 +92,31 @@ jobs:
70
92
- version : v${{ needs.release.outputs.release-version-major }}.${{ needs.release.outputs.release-version-minor }}
71
93
72
94
steps :
73
- - uses : actions/github-script@v4.0.2
95
+ - uses : actions/github-script@v6
74
96
with :
75
97
script : |
76
98
const tag = 'tags/${{ matrix.alias.version }}'
77
- const repo = {
78
- owner: context.repo.owner,
79
- repo: context.repo.repo
80
- }
99
+ await github.git.deleteRef({ ...context.repo, ref: tag }).catch(() => {})
100
+ await github.git.createRef({ ...context.repo, ref: `refs/${tag}` , sha: process.env.GITHUB_SHA })
101
+
102
+ template-sync :
103
+ timeout-minutes : 20
81
104
82
- await github.git.deleteRef({ ...repo, ref: tag }).catch(() => {})
83
- await github.git.createRef({ ...repo, ref: `refs/${tag}` , sha: process.env.GITHUB_SHA })
105
+ needs :
106
+ - metadata
107
+ - commit-lint
108
+ - super-linter
109
+
110
+ # only runs on main branch and only for the template
111
+ if : ${{ github.ref == 'refs/heads/master' && fromJSON(needs.metadata.outputs.repository).is_template }}
112
+
113
+ runs-on : ubuntu-latest
114
+
115
+ steps :
116
+ -
uses :
ahmadnassri/[email protected]
117
+
118
+
119
+
120
+ -
uses :
ahmadnassri/[email protected]
121
+ with :
122
+ github-token : ${{ secrets.GH_TOKEN }}
0 commit comments