Skip to content

ci: pin ores-lint workflow actions #77

ci: pin ores-lint workflow actions

ci: pin ores-lint workflow actions #77

Workflow file for this run

# Managed by .ores-lint/ - regenerated by the rollout script.
name: ores-lint
on:
pull_request:
workflow_dispatch:
# Add `push:` here once this repo's lint debt is paid down.
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- name: Detect project types
id: detect
run: |
{ [ -f package.json ] || git ls-files '*.js' '*.mjs' '*.cjs' '*.ts' '*.tsx' | grep -q .; } \
&& echo "js=true" >> "$GITHUB_OUTPUT" || echo "js=false" >> "$GITHUB_OUTPUT"
{ [ -f Cargo.toml ] || git ls-files '*.rs' | grep -q .; } \
&& echo "rs=true" >> "$GITHUB_OUTPUT" || echo "rs=false" >> "$GITHUB_OUTPUT"
{ [ -f pubspec.yaml ] || git ls-files '*.dart' | grep -q .; } \
&& echo "dart=true" >> "$GITHUB_OUTPUT" || echo "dart=false" >> "$GITHUB_OUTPUT"
{ [ -f gleam.toml ] || git ls-files '*.gleam' | grep -q .; } \
&& echo "gleam=true" >> "$GITHUB_OUTPUT" || echo "gleam=false" >> "$GITHUB_OUTPUT"
# Node is the runner for ESLint and for the cross-language require-send
# scanner, so it is installed whenever any supported language is present.
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
if: steps.detect.outputs.js == 'true' || steps.detect.outputs.rs == 'true' || steps.detect.outputs.dart == 'true' || steps.detect.outputs.gleam == 'true'
with:
node-version: '22'
# ESLint is a global tool here, not a repo dependency - so this job never
# runs `npm install` and never needs the repo's node_modules.
- name: Install eslint globally
if: steps.detect.outputs.js == 'true'
run: npm i -g eslint typescript-eslint
- name: Install clippy
if: steps.detect.outputs.rs == 'true'
run: rustup component add clippy || true
# Dart/Gleam SDKs are optional. When absent, dart.sh / gleam.sh skip
# with an actionable message; require-send.mjs still runs via Node.
- uses: dart-lang/setup-dart@6afc89df92d6eb3834022f73cd65adc8cdfcb92d # v1
if: steps.detect.outputs.dart == 'true'
continue-on-error: true
- name: Run ores-lint self-test
run: sh .ores-lint/selftest.sh
- name: Run ores-lint
run: sh .ores-lint/lint.sh
env:
# Warn-only. Set to 1 here to make lint findings fail this repo's CI.
ORES_LINT_STRICT: '0'