Skip to content

Rewrite as native Node.js action using Octokit instead of gh CLI (v3.0.0) #2

Rewrite as native Node.js action using Octokit instead of gh CLI (v3.0.0)

Rewrite as native Node.js action using Octokit instead of gh CLI (v3.0.0) #2

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: "20"
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Check npm version compatibility
uses: joshjohanning/npm-version-check-action@v1
- name: Run linting
run: npm run lint
- name: Run formatting check
run: npm run format:check
- name: Run tests
run: npm test
- name: Package the action
run: npm run package
- name: Validate action.yml
run: |
# Basic validation that action.yml is valid YAML
if command -v yq &> /dev/null; then
yq eval '.' action.yml > /dev/null
else
# Fallback to python yaml check
python -c "import yaml; yaml.safe_load(open('action.yml'))"
fi