File tree 2 files changed +41
-15
lines changed
2 files changed +41
-15
lines changed Original file line number Diff line number Diff line change 5
5
# See: https://github.com/actions/setup-node/#readme
6
6
NODE_VERSION : 16.x
7
7
8
- # See: https://docs.github.com/en/ actions/reference /events-that-trigger-workflows
8
+ # See: https://docs.github.com/actions/using-workflows /events-that-trigger-workflows
9
9
on :
10
+ create :
10
11
push :
11
12
paths :
12
13
- " .github/workflows/check-taskfiles.ya?ml"
28
29
repository_dispatch :
29
30
30
31
jobs :
32
+ run-determination :
33
+ runs-on : ubuntu-latest
34
+ outputs :
35
+ result : ${{ steps.determination.outputs.result }}
36
+ steps :
37
+ - name : Determine if the rest of the workflow should run
38
+ id : determination
39
+ run : |
40
+ RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x"
41
+ # The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead.
42
+ if [[
43
+ "${{ github.event_name }}" != "create" ||
44
+ "${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX
45
+ ]]; then
46
+ # Run the other jobs.
47
+ RESULT="true"
48
+ else
49
+ # There is no need to run the other jobs.
50
+ RESULT="false"
51
+ fi
52
+
53
+ echo "result=$RESULT" >> $GITHUB_OUTPUT
54
+
31
55
validate :
32
56
name : Validate ${{ matrix.file }}
57
+ needs : run-determination
58
+ if : needs.run-determination.outputs.result == 'true'
33
59
runs-on : ubuntu-latest
34
60
35
61
strategy :
54
80
id : download-schema
55
81
uses : carlosperate/download-file-action@v2
56
82
with :
57
- # See : https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/taskfile.json
58
- file-url : https://json.schemastore.org/taskfile .json
83
+ # Source : https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/taskfile.json
84
+ file-url : https://taskfile.dev/schema .json
59
85
location : ${{ runner.temp }}/taskfile-schema
60
86
61
87
- name : Install JSON schema validator
You can’t perform that action at this time.
0 commit comments