mirror of
https://github.com/ivuorinen/gh-action-readme.git
synced 2026-01-26 03:04:10 +00:00
* feat: rename internal/errors to internal/apperrors * fix(tests): clear env values before using in tests * feat: rename internal/errors to internal/apperrors * chore(deps): update go and all dependencies * chore: remove renovate from pre-commit, formatting * chore: sonarcloud fixes * feat: consolidate constants to appconstants/constants.go * chore: sonarcloud fixes * feat: simplification, deduplication, test utils * chore: sonarcloud fixes * chore: sonarcloud fixes * chore: sonarcloud fixes * chore: sonarcloud fixes * chore: clean up * fix: config discovery, const deduplication * chore: fixes
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@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
|
with:
|
|
fetch-depth: 0
|
|
token: ${{ github.token }}
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.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
|