Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/spell-check/.codespellrc
# See: https://github.com/codespell-project/codespell#using-a-config-file
[codespell]
# In the event of a false positive, add the problematic word, in all lowercase, to a comma-separated list here:
ignore-words-list = afterall
skip = ./.git,./dist,./go.mod,./go.sum,./package-lock.json,./pnpm-lock.yaml,./poetry.lock,./yarn.lock,./node_modules,./__tests__/testdata
builtin = clear,informal,en-GB_to_en-US
check-filenames =
check-hidden =
32 changes: 32 additions & 0 deletions .github/workflows/actions_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Release GitHub Actions

on:
workflow_dispatch:
inputs:
tag:
description: "Tag for the release"
required: true
node_version:
description: "Node.js version to use"
required: false
default: "24"
script:
description: "Command to build/bundle the action"
required: false
default: "npx tsc && npx ncc build"

permissions:
contents: read

jobs:
release:
permissions:
actions: read
id-token: write
contents: write

uses: step-security/reusable-workflows/.github/workflows/actions_release.yaml@v1
with:
tag: "${{ github.event.inputs.tag }}"
node_version: ${{ inputs.node_version || '24' }}
script: ${{ inputs.script || 'npx tsc && npx ncc build' }}
38 changes: 38 additions & 0 deletions .github/workflows/audit_package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: NPM Audit Fix Run

on:
workflow_dispatch:
inputs:
force:
description: "Use --force flag for npm audit fix?"
required: true
type: boolean
base_branch:
description: "Specify a base branch"
required: false
default: "main"
node_version:
description: "Node.js version to use"
required: false
default: "24"
script:
description: "Command to build/bundle the action"
required: false
default: "npx tsc && npx ncc build"
schedule:
- cron: "0 0 * * 1"

jobs:
audit-fix:
uses: step-security/reusable-workflows/.github/workflows/audit_fix.yml@v1
with:
force: ${{ inputs.force || false }}
base_branch: ${{ inputs.base_branch || 'main' }}
node_version: ${{ inputs.node_version || '24' }}
script: ${{ inputs.script || 'npx tsc && npx ncc build' }}

permissions:
contents: write
pull-requests: write
packages: read
issues: write
47 changes: 47 additions & 0 deletions .github/workflows/auto_cherry_pick.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Auto Cherry-Pick from Upstream

on:
workflow_run:
workflows: ["Release GitHub Actions"]
types:
- completed

workflow_dispatch:
inputs:
base_branch:
description: "Base branch to create the PR against"
required: true
default: "main"
mode:
description: "Run mode: cherry-pick or verify"
required: false
default: "cherry-pick"
node_version:
description: "Node.js version to use"
required: false
default: "24"
script:
description: "Command to build/bundle the action"
required: false
default: "npx tsc && npx ncc build"

pull_request:
types: [opened, synchronize, labeled]

permissions:
contents: write
pull-requests: write
packages: read
issues: write

jobs:
cherry-pick:
if: (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success') || github.event_name == 'workflow_dispatch' || contains(fromJson(toJson(github.event.pull_request.labels)).*.name, 'review-required')
uses: step-security/reusable-workflows/.github/workflows/auto_cherry_pick.yaml@v1
with:
original-owner: "go-task"
repo-name: "setup-task"
base_branch: ${{ inputs.base_branch || 'main' }}
mode: ${{ github.event_name == 'pull_request' && 'verify' || inputs.mode || 'cherry-pick' }}
node_version: ${{ inputs.node_version || '24' }}
script: ${{ inputs.script || 'npx tsc && npx ncc build' }}
252 changes: 252 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,252 @@
name: CI

on:
push:

permissions:
contents: read

jobs:
check-typescript:
name: Lint (oxlint)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version-file: package.json
cache: "npm"
- uses: ./
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x
- run: task ts:lint

check-tsconfig:
name: Validate tsconfig
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version-file: package.json
cache: "npm"
- uses: ./
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x
- run: task --silent ts:validate

check-action-metadata:
name: Validate action.yml
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version-file: package.json
cache: "npm"
- uses: ./
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x
- run: task --silent action:validate

check-npm-validate:
name: Validate package.json
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version-file: package.json
cache: "npm"
- uses: ./
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x
- run: task --silent npm:validate

check-npm-sync:
name: Lockfile sync
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version-file: package.json
cache: "npm"
- uses: ./
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x
- run: task npm:install-deps
- run: git diff --color --exit-code package-lock.json

check-markdown:
name: Markdown ${{ matrix.step }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
step: [lint, check-links]
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version-file: package.json
cache: "npm"
- if: matrix.step == 'lint'
uses: xt0rted/markdownlint-problem-matcher@v3
Comment thread
anurag-stepsecurity marked this conversation as resolved.
- uses: ./
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x
- run: task --silent markdown:${{ matrix.step }}

check-format:
name: oxfmt formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version-file: package.json
cache: "npm"
- uses: ./
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x
- run: npx oxfmt --check .

check-license:
name: LICENSE detection
runs-on: ubuntu-latest
env:
EXPECTED_LICENSE_FILENAME: LICENSE
EXPECTED_LICENSE_TYPE: GPL-3.0
steps:
- uses: actions/checkout@v7
- uses: ruby/setup-ruby@v1
with:
ruby-version: ruby
- run: gem install licensee
- name: Check license file
run: |
EXIT_STATUS=0
LICENSEE_OUTPUT="$(licensee detect --json --confidence=100)"

DETECTED_LICENSE_FILE="$(echo "$LICENSEE_OUTPUT" | jq .matched_files[0].filename | tr --delete '\r')"
echo "Detected license file: $DETECTED_LICENSE_FILE"
if [ "$DETECTED_LICENSE_FILE" != "\"${EXPECTED_LICENSE_FILENAME}\"" ]; then
echo "::error file=${DETECTED_LICENSE_FILE}::detected license file $DETECTED_LICENSE_FILE doesn't match expected: $EXPECTED_LICENSE_FILENAME"
EXIT_STATUS=1
fi

DETECTED_LICENSE_TYPE="$(echo "$LICENSEE_OUTPUT" | jq .matched_files[0].matched_license | tr --delete '\r')"
echo "Detected license type: $DETECTED_LICENSE_TYPE"
Comment thread
anurag-stepsecurity marked this conversation as resolved.
if [ "$DETECTED_LICENSE_TYPE" != "\"${EXPECTED_LICENSE_TYPE}\"" ]; then
echo "::error file=${DETECTED_LICENSE_FILE}::detected license type $DETECTED_LICENSE_TYPE doesn't match expected \"${EXPECTED_LICENSE_TYPE}\""
EXIT_STATUS=1
fi

exit $EXIT_STATUS

spell-check:
name: Spell check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v6
with:
python-version: "3.14"
- run: pip install poetry
- uses: ./
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x
- run: task general:check-spelling

test-typescript:
name: Tests (${{ matrix.operating-system }})
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version-file: package.json
cache: "npm"
- uses: ./
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x
- run: task ts:test

check-packaging:
name: dist bundle up to date
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version-file: package.json
cache: "npm"
- uses: ./
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x
- run: task ts:build
# Ignore CR because ncc output has mixed line endings on Windows checkouts.
- run: git diff --ignore-cr-at-eol --color --exit-code dist

integration-defaults:
name: Integration - defaults
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Run action with defaults
uses: ./
- run: task --version

integration-version:
name: Integration - ${{ matrix.version.input }} / ${{ matrix.runs-on }}
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
runs-on: [ubuntu-latest, windows-latest, macos-latest]
version:
- input: 3.36.x
expected: "Task version: v3.36.0 (h1:XVJ5hQ5hdzTAulHpAGzbUMUuYr9MUOEQFOFazI3hUsY=)"
- input: 3.37.2
expected: "Task version: v3.37.2 (h1:Jwgvo+2vX79Fu+44xPxVKC5DIkUE89QeDjN2tmYaQzA=)"
- input: 3.50.0
expected: "3.50.0"
steps:
- uses: actions/checkout@v7
- uses: ./
with:
version: ${{ matrix.version.input }}
repo-token: ${{ github.token }}
- shell: bash
run: |
[[ "$(task --version)" == "${{ matrix.version.expected }}" ]]

integration-invalid-version:
name: Integration - invalid version rejected
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- id: setup-task
continue-on-error: true
uses: ./
with:
version: 2.42.x
- if: steps.setup-task.outcome == 'success'
run: |
echo "::error::The action run was expected to fail, but passed!"
exit 1
2 changes: 1 addition & 1 deletion .github/workflows/claude_review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Claude Code Review

on:
pull_request:
types: [ opened, synchronize, labeled ]
types: [opened, synchronize, labeled]

jobs:
code-review:
Expand Down
Loading
Loading