mirror of
https://github.com/ivuorinen/gh-action-readme.git
synced 2026-02-11 00:48:12 +00:00
Initial commit
This commit is contained in:
308
testdata/composite-action/README.md
vendored
Normal file
308
testdata/composite-action/README.md
vendored
Normal file
@@ -0,0 +1,308 @@
|
||||
# Composite Example Action
|
||||
|
||||
|
||||
<div align="center">
|
||||
<img src="https://img.shields.io/badge/icon-package-blue" alt="package" />
|
||||
<img src="https://img.shields.io/badge/status-stable-brightgreen" alt="Status" />
|
||||
<img src="https://img.shields.io/badge/license-MIT-blue" alt="License" />
|
||||
</div>
|
||||
|
||||
|
||||
## Overview
|
||||
|
||||
Test Composite Action for gh-action-readme dependency analysis
|
||||
|
||||
This GitHub Action provides a robust solution for your CI/CD pipeline with comprehensive configuration options and detailed output information.
|
||||
|
||||
## Table of Contents
|
||||
|
||||
- [Quick Start](#quick-start)
|
||||
- [Configuration](#configuration)
|
||||
- [Input Parameters](#input-parameters)
|
||||
- [Output Parameters](#output-parameters)
|
||||
- [Examples](#examples)
|
||||
- [Dependencies](#-dependencies)
|
||||
- [Troubleshooting](#troubleshooting)
|
||||
- [Contributing](#contributing)
|
||||
- [License](#license)
|
||||
|
||||
## Quick Start
|
||||
|
||||
Add the following step to your GitHub Actions workflow:
|
||||
|
||||
```yaml
|
||||
name: CI/CD Pipeline
|
||||
on:
|
||||
push:
|
||||
branches: [ main, develop ]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Composite Example Action
|
||||
uses: your-org/ @v1
|
||||
with:
|
||||
node-version: "20"
|
||||
working-directory: "."
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
This action supports various configuration options to customize its behavior according to your needs.
|
||||
|
||||
|
||||
### Input Parameters
|
||||
|
||||
| Parameter | Description | Type | Required | Default Value |
|
||||
|-----------|-------------|------|----------|---------------|
|
||||
| **`node-version`** | Node.js version to use | `string` | ❌ No | `20` |
|
||||
| **`working-directory`** | Working directory | `string` | ❌ No | `.` |
|
||||
|
||||
#### Parameter Details
|
||||
|
||||
|
||||
##### `node-version`
|
||||
|
||||
Node.js version to use
|
||||
|
||||
- **Type**: String
|
||||
- **Required**: No
|
||||
- **Default**: `20`
|
||||
|
||||
```yaml
|
||||
with:
|
||||
node-version: "20"
|
||||
```
|
||||
|
||||
|
||||
##### `working-directory`
|
||||
|
||||
Working directory
|
||||
|
||||
- **Type**: String
|
||||
- **Required**: No
|
||||
- **Default**: `.`
|
||||
|
||||
```yaml
|
||||
with:
|
||||
working-directory: "."
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
### Output Parameters
|
||||
|
||||
This action provides the following outputs that can be used in subsequent workflow steps:
|
||||
|
||||
| Parameter | Description | Usage |
|
||||
|-----------|-------------|-------|
|
||||
| **`build-result`** | Build result status | `\${{ steps. .outputs.build-result }}` |
|
||||
|
||||
#### Using Outputs
|
||||
|
||||
```yaml
|
||||
- name: Composite Example Action
|
||||
id: action-step
|
||||
uses: your-org/ @v1
|
||||
|
||||
- name: Use Output
|
||||
run: |
|
||||
echo "build-result: \${{ steps.action-step.outputs.build-result }}"
|
||||
```
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### Basic Usage
|
||||
|
||||
```yaml
|
||||
- name: Basic Composite Example Action
|
||||
uses: your-org/ @v1
|
||||
with:
|
||||
node-version: "20"
|
||||
working-directory: "."
|
||||
```
|
||||
|
||||
### Advanced Configuration
|
||||
|
||||
```yaml
|
||||
- name: Advanced Composite Example Action
|
||||
uses: your-org/ @v1
|
||||
with:
|
||||
node-version: "20"
|
||||
working-directory: "."
|
||||
env:
|
||||
GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
|
||||
```
|
||||
|
||||
### Conditional Usage
|
||||
|
||||
```yaml
|
||||
- name: Conditional Composite Example Action
|
||||
if: github.event_name == 'push'
|
||||
uses: your-org/ @v1
|
||||
with:
|
||||
node-version: "20"
|
||||
working-directory: "."
|
||||
```
|
||||
|
||||
|
||||
## 📦 Dependencies
|
||||
|
||||
This action uses the following dependencies:
|
||||
|
||||
| Action | Version | Author | Description |
|
||||
|--------|---------|--------|-------------|
|
||||
| [Checkout repository](https://github.com/marketplace/actions/checkout) | v4 | [actions](https://github.com/actions) | |
|
||||
| [Setup Node.js](https://github.com/marketplace/actions/setup-node) | v4 | [actions](https://github.com/actions) | |
|
||||
| Install dependencies | 🔒 | [ivuorinen](https://github.com/ivuorinen) | Shell script execution |
|
||||
| Run tests | 🔒 | [ivuorinen](https://github.com/ivuorinen) | Shell script execution |
|
||||
| [Build project](https://github.com/marketplace/actions/setup-node) | v4 | [actions](https://github.com/actions) | |
|
||||
|
||||
<details>
|
||||
<summary>📋 Dependency Details</summary>
|
||||
|
||||
|
||||
### Checkout repository @ v4
|
||||
|
||||
|
||||
- 📌 **Floating Version**: Using latest version (consider pinning for security)
|
||||
|
||||
- 👤 **Author**: [actions](https://github.com/actions)
|
||||
- 🏪 **Marketplace**: [View on GitHub Marketplace](https://github.com/marketplace/actions/checkout)
|
||||
- 📂 **Source**: [View Source](https://github.com/actions/checkout)
|
||||
|
||||
- **Configuration**:
|
||||
```yaml
|
||||
with:
|
||||
fetch-depth: 0
|
||||
token: ${{ github.token }}
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Setup Node.js @ v4
|
||||
|
||||
|
||||
- 📌 **Floating Version**: Using latest version (consider pinning for security)
|
||||
|
||||
- 👤 **Author**: [actions](https://github.com/actions)
|
||||
- 🏪 **Marketplace**: [View on GitHub Marketplace](https://github.com/marketplace/actions/setup-node)
|
||||
- 📂 **Source**: [View Source](https://github.com/actions/setup-node)
|
||||
|
||||
- **Configuration**:
|
||||
```yaml
|
||||
with:
|
||||
cache: npm
|
||||
node-version: ${{ inputs.node-version }}
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Install dependencies
|
||||
|
||||
|
||||
- 🔒 **Pinned Version**: Locked to specific version for security
|
||||
|
||||
- 👤 **Author**: [ivuorinen](https://github.com/ivuorinen)
|
||||
|
||||
- 📂 **Source**: [View Source](https://github.com/ivuorinen/gh-action-readme/blob/main/action.yml#L30)
|
||||
|
||||
|
||||
|
||||
### Run tests
|
||||
|
||||
|
||||
- 🔒 **Pinned Version**: Locked to specific version for security
|
||||
|
||||
- 👤 **Author**: [ivuorinen](https://github.com/ivuorinen)
|
||||
|
||||
- 📂 **Source**: [View Source](https://github.com/ivuorinen/gh-action-readme/blob/main/action.yml#L40)
|
||||
|
||||
|
||||
|
||||
### Build project @ v4
|
||||
|
||||
|
||||
- 📌 **Floating Version**: Using latest version (consider pinning for security)
|
||||
|
||||
- 👤 **Author**: [actions](https://github.com/actions)
|
||||
- 🏪 **Marketplace**: [View on GitHub Marketplace](https://github.com/marketplace/actions/setup-node)
|
||||
- 📂 **Source**: [View Source](https://github.com/actions/setup-node)
|
||||
|
||||
- **Configuration**:
|
||||
```yaml
|
||||
with:
|
||||
node-version: ${{ inputs.node-version }}
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
### Same Repository Dependencies
|
||||
|
||||
- [Install dependencies](https://github.com/ivuorinen/gh-action-readme/blob/main/action.yml#L30) - Shell script execution
|
||||
|
||||
- [Run tests](https://github.com/ivuorinen/gh-action-readme/blob/main/action.yml#L40) - Shell script execution
|
||||
|
||||
|
||||
|
||||
</details>
|
||||
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
|
||||
1. **Authentication Errors**: Ensure you have set up the required secrets in your repository settings.
|
||||
2. **Permission Issues**: Check that your GitHub token has the necessary permissions.
|
||||
3. **Configuration Errors**: Validate your input parameters against the schema.
|
||||
|
||||
### Getting Help
|
||||
|
||||
- Check the [action.yml](./action.yml) for the complete specification
|
||||
- Review the [examples](./examples/) directory for more use cases
|
||||
- Open an issue if you encounter problems
|
||||
|
||||
## Contributing
|
||||
|
||||
We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.
|
||||
|
||||
### Development Setup
|
||||
|
||||
1. Fork this repository
|
||||
2. Create a feature branch
|
||||
3. Make your changes
|
||||
4. Add tests if applicable
|
||||
5. Submit a pull request
|
||||
|
||||
## License
|
||||
|
||||
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
|
||||
|
||||
## Support
|
||||
|
||||
If you find this action helpful, please consider:
|
||||
|
||||
- ⭐ Starring this repository
|
||||
- 🐛 Reporting issues
|
||||
- 💡 Suggesting improvements
|
||||
- 🤝 Contributing code
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
<sub>📚 Documentation generated with <a href="https://github.com/ivuorinen/gh-action-readme">gh-action-readme</a></sub>
|
||||
</div>
|
||||
53
testdata/composite-action/action.yml
vendored
Normal file
53
testdata/composite-action/action.yml
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
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@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
token: ${{ github.token }}
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
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
|
||||
uses: actions/setup-node@v4
|
||||
id: build
|
||||
with:
|
||||
node-version: ${{ inputs.node-version }}
|
||||
|
||||
branding:
|
||||
icon: package
|
||||
color: blue
|
||||
37
testdata/example-action/README.md
vendored
Normal file
37
testdata/example-action/README.md
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
# Example Action
|
||||
|
||||
|
||||
> Test Action for gh-action-readme
|
||||
|
||||
## Usage
|
||||
|
||||
```yaml
|
||||
- uses: ivuorinen/gh-action-readme/example-action@v1
|
||||
with:
|
||||
input1: # First input (default: foo)
|
||||
input2: # Second input
|
||||
```
|
||||
|
||||
## Inputs
|
||||
|
||||
|
||||
- **input1**: First input (**required**) (default: foo)
|
||||
|
||||
- **input2**: Second input
|
||||
|
||||
|
||||
|
||||
## Outputs
|
||||
|
||||
|
||||
- **result**: Result output
|
||||
|
||||
|
||||
|
||||
## Example
|
||||
|
||||
See the [action.yml](./action.yml) for a full reference.
|
||||
|
||||
---
|
||||
|
||||
*Auto-generated by [gh-action-readme](https://github.com/ivuorinen/gh-action-readme)*
|
||||
20
testdata/example-action/action.yml
vendored
Normal file
20
testdata/example-action/action.yml
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
name: Example Action
|
||||
description: 'Test Action for gh-action-readme'
|
||||
inputs:
|
||||
input1:
|
||||
description: First input
|
||||
required: true
|
||||
default: foo
|
||||
input2:
|
||||
description: Second input
|
||||
required: false
|
||||
outputs:
|
||||
result:
|
||||
description: Result output
|
||||
runs:
|
||||
using: "node20"
|
||||
main: "dist/index.js"
|
||||
branding:
|
||||
icon: check
|
||||
color: green
|
||||
|
||||
9
testdata/example-action/config.yaml
vendored
Normal file
9
testdata/example-action/config.yaml
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
# Action-specific configuration
|
||||
theme: "github"
|
||||
variables:
|
||||
action_specific: "This is action-specific config"
|
||||
permissions:
|
||||
contents: read
|
||||
runs_on:
|
||||
- "ubuntu-latest"
|
||||
- "macos-latest"
|
||||
Reference in New Issue
Block a user