Skip to content

Commit fb8c304

Browse files
authored
Merge pull request #41 from arduino/fix_deps
Fixed deps with dependabot suggestions / Updated check-taskfile workflow
2 parents 10d3d28 + 4620b4c commit fb8c304

File tree

2 files changed

+41
-15
lines changed

2 files changed

+41
-15
lines changed

.github/workflows/check-taskfiles.yml

+29-3
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ env:
55
# See: https://github.com/actions/setup-node/#readme
66
NODE_VERSION: 16.x
77

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
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:
@@ -54,8 +80,8 @@ jobs:
5480
id: download-schema
5581
uses: carlosperate/download-file-action@v2
5682
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
5985
location: ${{ runner.temp }}/taskfile-schema
6086

6187
- name: Install JSON schema validator

package-lock.json

+12-12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)