-
Notifications
You must be signed in to change notification settings - Fork 1
feat: Onboard go-task/setup-task action #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 = |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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' }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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' }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| - 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" | ||
|
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 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.