mirror of
https://github.com/ivuorinen/gh-action-readme.git
synced 2026-03-11 12:59:43 +00:00
* ci: add permissions: {} to CI workflow with job-level contents: read
* ci: enforce least-privilege permissions in security workflow
* ci: enforce least-privilege permissions in commitlint workflow
* ci: enforce least-privilege permissions in pr-lint workflow and update actions
* ci: enforce least-privilege permissions in stale workflow and update actions
* ci: enforce least-privilege permissions in sync-labels workflow and update actions
* ci: enforce least-privilege permissions in release workflow and update actions
* chore(actions): update ivuorinen/actions/codeql-analysis (v2026.03.06 → v2026.03.09)
* chore(deps): update testdata composite action dependencies
67 lines
1.8 KiB
YAML
67 lines
1.8 KiB
YAML
---
|
|
name: Composite Example Action
|
|
description: 'Test Composite Action for gh-action-readme dependency analysis'
|
|
inputs:
|
|
node-version:
|
|
description: Node.js version to use
|
|
required: false
|
|
default: '20'
|
|
working-directory:
|
|
description: Working directory
|
|
required: false
|
|
default: '.'
|
|
outputs:
|
|
build-result:
|
|
description: Build result status
|
|
value: ${{ steps.build.outputs.result }}
|
|
runs:
|
|
using: composite
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
fetch-depth: 0
|
|
token: ${{ github.token }}
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
|
|
with:
|
|
node-version: ${{ inputs.node-version }}
|
|
cache: 'npm'
|
|
|
|
- name: Install dependencies
|
|
shell: bash
|
|
run: |
|
|
cd ${{ inputs.working-directory }}
|
|
npm ci
|
|
|
|
- name: Run tests
|
|
shell: bash
|
|
run: |
|
|
npm test
|
|
echo "Tests completed successfully"
|
|
env:
|
|
NODE_ENV: test
|
|
|
|
- name: Build project
|
|
shell: bash
|
|
id: build
|
|
run: |
|
|
set -u
|
|
cd ${{ inputs.working-directory }}
|
|
npm run build
|
|
# Capture exit code immediately to avoid fragility with intervening commands
|
|
build_exit_code=$?
|
|
# Write result to GITHUB_OUTPUT based on captured exit code
|
|
# Note: We do not use 'set -e' because we need to handle build failures
|
|
# gracefully and report them via the output rather than failing the step
|
|
if [ $build_exit_code -eq 0 ]; then
|
|
echo "result=success" >> $GITHUB_OUTPUT
|
|
else
|
|
echo "result=failure" >> $GITHUB_OUTPUT
|
|
fi
|
|
|
|
branding:
|
|
icon: package
|
|
color: blue
|