Skip to content

Commit e36c43c

Browse files
Sync check-taskfiles with upstream template
1 parent 399e80e commit e36c43c

File tree

1 file changed

+28
-2
lines changed

1 file changed

+28
-2
lines changed

.github/workflows/check-taskfiles.yml

+28-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ env:
77

88
# See: https://docs.github.com/actions/using-workflows/events-that-trigger-workflows
99
on:
10+
create:
1011
push:
1112
paths:
1213
- ".github/workflows/check-taskfiles.ya?ml"
@@ -28,8 +29,33 @@ on:
2829
repository_dispatch:
2930

3031
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+
3155
validate:
3256
name: Validate ${{ matrix.file }}
57+
needs: run-determination
58+
if: needs.run-determination.outputs.result == 'true'
3359
runs-on: ubuntu-latest
3460

3561
strategy:
@@ -53,8 +79,8 @@ jobs:
5379
id: download-schema
5480
uses: carlosperate/download-file-action@v2
5581
with:
56-
# See: https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/taskfile.json
57-
file-url: https://json.schemastore.org/taskfile.json
82+
# Source: https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/taskfile.json
83+
file-url: https://taskfile.dev/schema.json
5884
location: ${{ runner.temp }}/taskfile-schema
5985

6086
- name: Install JSON schema validator

0 commit comments

Comments
 (0)