Rewrite as native Node.js action using Octokit instead of gh CLI (v3.0.0) #3
Workflow file for this run
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
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 |