Skip to content

Commit

Permalink
Merge pull request #29 from arduino/sync-check-taskfiles
Browse files Browse the repository at this point in the history
Sync `check-taskfiles` workflow with its upstream template
  • Loading branch information
MatteoPologruto authored Apr 11, 2023
2 parents c303fec + a21e769 commit 4e84635
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions .github/workflows/check-taskfiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ env:

# See: https://docs.github.com/actions/using-workflows/events-that-trigger-workflows
on:
create:
push:
paths:
- ".github/workflows/check-taskfiles.ya?ml"
Expand All @@ -26,8 +27,33 @@ on:
repository_dispatch:

jobs:
run-determination:
runs-on: ubuntu-latest
outputs:
result: ${{ steps.determination.outputs.result }}
steps:
- name: Determine if the rest of the workflow should run
id: determination
run: |
RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x"
# The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead.
if [[
"${{ github.event_name }}" != "create" ||
"${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX
]]; then
# Run the other jobs.
RESULT="true"
else
# There is no need to run the other jobs.
RESULT="false"
fi
echo "result=$RESULT" >> $GITHUB_OUTPUT
validate:
name: Validate ${{ matrix.file }}
needs: run-determination
if: needs.run-determination.outputs.result == 'true'
runs-on: ubuntu-latest

strategy:
Expand All @@ -50,8 +76,8 @@ jobs:
id: download-schema
uses: carlosperate/download-file-action@v2
with:
# See: https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/taskfile.json
file-url: https://json.schemastore.org/taskfile.json
# Source: https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/taskfile.json
file-url: https://taskfile.dev/schema.json
location: ${{ runner.temp }}/taskfile-schema

- name: Install JSON schema validator
Expand Down

0 comments on commit 4e84635

Please sign in to comment.