docs: update README.md with corrected CSRF configuration example #48
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", "v[4-9].x.x" ] | |
pull_request: | |
branches: [ "main", "v[4-9].x.x" ] | |
permissions: | |
checks: write | |
contents: write | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
env: | |
EXPECTED_EXPORT_LINE_LENGTH: 528 | |
EXPECTED_FILE_COUNT: 4 | |
steps: | |
- name: Checkout csrf-csrf | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
- name: Install Dependencies | |
run: npm ci | |
- name: Build | |
run: npm run build --if-present | |
- name: Check number of output files | |
run: | | |
output_file_count=$(ls -l ./dist | grep "^-" | wc -l) | |
if [ "$output_file_count" -ne 4 ]; then | |
echo "Error: Output file count is $output_file_count, expected 4" | |
exit 1 | |
else | |
echo "Output file count is as expected" | |
fi | |
- name: Check export line length for index.d.ts | |
run: | | |
export_line=$(tail -n 2 dist/index.d.ts | head -n 2) | |
export_line_length=${#export_line} | |
if [ "$export_line_length" -ne $EXPECTED_EXPORT_LINE_LENGTH ]; then | |
echo "Error: Export line length is $export_line_length, expected $EXPECTED_EXPORT_LINE_LENGTH" | |
exit 1 | |
fi | |
- name: Check export line length for index.d.cts | |
run: | | |
export_line=$(tail -n 2 dist/index.d.ts | head -n 2) | |
export_line_length=${#export_line} | |
if [ "$export_line_length" -ne $EXPECTED_EXPORT_LINE_LENGTH ]; then | |
echo "Error: Export line length is $export_line_length, expected $EXPECTED_EXPORT_LINE_LENGTH" | |
exit 1 | |
fi | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout csrf-csrf | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
- name: Setup Biome CLI | |
uses: biomejs/setup-biome@v2 | |
- name: Run Biome | |
run: biome ci | |
test: | |
name: Test Coverage | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout csrf-csrf | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
cache: 'npm' | |
- name: Install Dependencies | |
run: npm ci | |
- name: Run Test Coverage | |
run: npm run test:coverage -- --silent --coverage.reporter=lcov | |
- name: Coveralls | |
uses: coverallsapp/github-action@v2 | |
with: | |
path-to-lcov: ./coverage/lcov.info |