mirror of
https://github.com/ivuorinen/actions.git
synced 2026-01-26 03:23:59 +00:00
* feat: first pass simplification
* refactor: simplify actions repository structure
Major simplification reducing actions from 44 to 30:
Consolidations:
- Merge biome-check + biome-fix → biome-lint (mode: check/fix)
- Merge eslint-check + eslint-fix → eslint-lint (mode: check/fix)
- Merge prettier-check + prettier-fix → prettier-lint (mode: check/fix)
- Merge 5 version-detect actions → language-version-detect (language param)
Removals:
- common-file-check, common-retry (better served by external tools)
- docker-publish-gh, docker-publish-hub (consolidated into docker-publish)
- github-release (redundant with existing tooling)
- set-git-config (no longer needed)
- version-validator (functionality moved to language-version-detect)
Fixes:
- Rewrite docker-publish to use official Docker actions directly
- Update validate-inputs example (eslint-fix → eslint-lint)
- Update tests and documentation for new structure
Result: ~6,000 lines removed, cleaner action catalog, maintained functionality.
* refactor: complete action simplification and cleanup
Remove deprecated actions and update remaining actions:
Removed:
- common-file-check, common-retry: utility actions
- docker-publish-gh, docker-publish-hub: replaced by docker-publish wrapper
- github-release, version-validator, set-git-config: no longer needed
- Various version-detect actions: replaced by language-version-detect
Updated:
- docker-publish: rewrite as simple wrapper using official Docker actions
- validate-inputs: update example (eslint-fix → eslint-lint)
- Multiple actions: update configurations and remove deprecated dependencies
- Tests: update integration/unit tests for new structure
- Documentation: update README, remove test for deleted actions
Configuration updates:
- Linter configs, ignore files for new structure
- Makefile, pyproject.toml updates
* fix: enforce POSIX compliance in GitHub workflows
Convert all workflow shell scripts to POSIX-compliant sh:
Critical fixes:
- Replace bash with sh in all shell declarations
- Replace [[ with [ for test conditions
- Replace == with = for string comparisons
- Replace set -euo pipefail with set -eu
- Split compound AND conditions into separate [ ] tests
Files updated:
- .github/workflows/test-actions.yml (7 shell declarations, 10 test operators)
- .github/workflows/security-suite.yml (set -eu)
- .github/workflows/action-security.yml (2 shell declarations)
- .github/workflows/pr-lint.yml (3 shell declarations)
- .github/workflows/issue-stats.yml (1 shell declaration)
Ensures compatibility with minimal sh implementations and aligns with
CLAUDE.md standards requiring POSIX shell compliance across all scripts.
All tests pass: 764 pytest tests, 100% coverage.
* fix: add missing permissions for private repository support
Add critical permissions to pr-lint workflow for private repositories:
Workflow-level permissions:
+ packages: read - Access private npm/PyPI/Composer packages
Job-level permissions:
+ packages: read - Access private packages during dependency installation
+ checks: write - Create and update check runs
Fixes failures when:
- Installing private npm packages from GitHub Packages
- Installing private Composer dependencies
- Installing private Python packages
- Creating status checks with github-script
Valid permission scopes per actionlint:
actions, attestations, checks, contents, deployments, discussions,
id-token, issues, models, packages, pages, pull-requests,
repository-projects, security-events, statuses
Note: "workflows" and "metadata" are NOT valid permission scopes
(they are PAT-only scopes or auto-granted respectively).
* docs: update readmes
* fix: replace bash-specific 'source' with POSIX '.' command
Replace all occurrences of 'source' with '.' (dot) for POSIX compliance:
Changes in python-lint-fix/action.yml:
- Line 165: source .venv/bin/activate → . .venv/bin/activate
- Line 179: source .venv/bin/activate → . .venv/bin/activate
- Line 211: source .venv/bin/activate → . .venv/bin/activate
Also fixed bash-specific test operator:
- Line 192: [[ "$FAIL_ON_ERROR" == "true" ]] → [ "$FAIL_ON_ERROR" = "true" ]
The 'source' command is bash-specific. POSIX sh uses '.' (dot) to source files.
Both commands have identical functionality but '.' is portable across all
POSIX-compliant shells.
* security: fix code injection vulnerability in docker-publish
Fix CodeQL code injection warning (CWE-094, CWE-095, CWE-116):
Issue: inputs.context was used directly in GitHub Actions expression
without sanitization at line 194, allowing potential code injection
by external users.
Fix: Use environment variable indirection to prevent expression injection:
- Added env.BUILD_CONTEXT to capture inputs.context
- Changed context parameter to use ${{ env.BUILD_CONTEXT }}
Environment variables are evaluated after expression compilation,
preventing malicious code execution during workflow parsing.
Security Impact: Medium severity (CVSS 5.0)
Identified by: GitHub Advanced Security (CodeQL)
Reference: https://github.com/ivuorinen/actions/pull/353#pullrequestreview-3481935924
* security: prevent credential persistence in pr-lint checkout
Add persist-credentials: false to checkout step to mitigate untrusted
checkout vulnerability. This prevents GITHUB_TOKEN from being accessible
to potentially malicious PR code.
Fixes: CodeQL finding CWE-829 (untrusted checkout on privileged workflow)
* fix: prevent security bot from overwriting unrelated comments
Replace broad string matching with unique HTML comment marker for
identifying bot-generated comments. Previously, any comment containing
'Security Analysis' or '🔐 GitHub Actions Permissions' would be
overwritten, causing data loss.
Changes:
- Add unique marker: <!-- security-analysis-bot-comment -->
- Prepend marker to generated comment body
- Update comment identification to use marker only
- Add defensive null check for comment.body
This fixes critical data loss bug where user comments could be
permanently overwritten by the security analysis bot.
Follows same proven pattern as test-actions.yml coverage comments.
* improve: show concise permissions diff instead of full blocks
Replace verbose full-block permissions diff with line-by-line changes.
Now shows only added/removed permissions, making output much more
readable.
Changes:
- Parse permissions into individual lines
- Compare old vs new to identify actual changes
- Show only removed (-) and added (+) lines in diff
- Collapse unchanged permissions into details section (≤3 items)
- Show count summary for many unchanged permissions (>3 items)
Example output:
Before: 30+ lines showing entire permissions block
After: 3-5 lines showing only what changed
This addresses user feedback that permissions changes were too verbose.
* security: add input validation and trust model documentation
Add comprehensive security validation for docker-publish action to prevent
code injection attacks (CWE-094, CWE-116).
Changes:
- Add validation for context input (reject absolute paths, warn on URLs)
- Add validation for dockerfile input (reject absolute/URL paths)
- Document security trust model in README
- Add best practices for secure usage
- Explain validation rules and threat model
Prevents malicious actors from:
- Building from arbitrary file system locations
- Fetching Dockerfiles from untrusted remote sources
- Executing code injection through build context manipulation
Addresses: CodeRabbit review comments #2541434325, #2541549615
Fixes: GitHub Advanced Security code injection findings
* security: replace unmaintained nick-fields/retry with step-security/retry
Replace nick-fields/retry with step-security/retry across all 4 actions:
- csharp-build/action.yml
- php-composer/action.yml
- go-build/action.yml
- ansible-lint-fix/action.yml
The nick-fields/retry action has security vulnerabilities and low maintenance.
step-security/retry is a drop-in replacement with full API compatibility.
All inputs (timeout_minutes, max_attempts, command, retry_wait_seconds) are
compatible. Using SHA-pinned version for security.
Addresses CodeRabbit review comment #2541549598
* test: add is_input_required() helper function
Add helper function to check if an action input is required, reducing
duplication across test suites.
The function:
- Takes action_file and input_name as parameters
- Uses validation_core.py to query the 'required' property
- Returns 0 (success) if input is required
- Returns 1 (failure) if input is optional
This DRY improvement addresses CodeRabbit review comment #2541549572
* feat: add mode validation convention mapping
Add "mode" to the validation conventions mapping for lint actions
(eslint-lint, biome-lint, prettier-lint).
Note: The update-validators script doesn't currently recognize "string"
as a validator type, so mode validation coverage remains at 93%. The
actions already have inline validation for mode (check|fix), so this is
primarily for improving coverage metrics.
Addresses part of CodeRabbit review comment #2541549570
(validation coverage improvement)
* docs: fix CLAUDE.md action counts and add missing action
- Update action count from 31 to 29 (line 42)
- Add missing 'action-versioning' to Utilities category (line 74)
Addresses CodeRabbit review comments #2541553130 and #2541553110
* docs: add security considerations to docker-publish
Add security documentation to both action.yml header and README.md:
- Trust model explanation
- Input validation details for context and dockerfile
- Attack prevention information
- Best practices for secure usage
The documentation was previously removed when README was autogenerated.
Now documented in both places to ensure it persists.
* fix: correct step ID reference in docker-build
Fix incorrect step ID reference in platforms output:
- Changed steps.platforms.outputs.built to steps.detect-platforms.outputs.platforms
- The step is actually named 'detect-platforms' not 'platforms'
- Ensures output correctly references the detect-platforms step defined at line 188
* fix: ensure docker-build platforms output is always available
Make detect-platforms step unconditional to fix broken output contract.
The platforms output (line 123) references steps.detect-platforms.outputs.platforms,
but the step only ran when auto-detect-platforms was true (default: false).
This caused undefined output in most cases.
Changes:
- Remove 'if' condition from detect-platforms step
- Step now always runs and always produces platforms output
- When auto-detect is false: outputs configured architectures
- When auto-detect is true: outputs detected platforms or falls back to architectures
- Add '|| true' to grep to prevent errors when no platforms detected
Fixes CodeRabbit review comment #2541824904
* security: remove env var indirection in docker-publish BUILD_CONTEXT
Remove BUILD_CONTEXT env var indirection to address GitHub Advanced Security alert.
The inputs.context is validated at lines 137-147 (rejects absolute paths, warns on URLs)
before being used, so the env var indirection is unnecessary and triggers false positive
code injection warnings.
Changes:
- Remove BUILD_CONTEXT env var (line 254)
- Use inputs.context directly (line 256 → 254)
- Input validation remains in place (lines 137-147)
Fixes GitHub Advanced Security code injection alerts (comments #2541405269, #2541522320)
* feat: implement mode_enum validator for lint actions
Add mode_enum validator to validate mode inputs in linting actions.
Changes to conventions.py:
- Add 'mode_enum' to exact_matches mapping (line 215)
- Add 'mode_enum' to PHP-specific validators list (line 560)
- Implement _validate_mode_enum() method (lines 642-660)
- Validates mode values against ['check', 'fix']
- Returns clear error messages for invalid values
Updated rules.yml files:
- biome-lint: Add mode: mode_enum convention
- eslint-lint: Add mode: mode_enum convention
- prettier-lint: Add mode: mode_enum convention
- All rules.yml: Fix YAML formatting with yamlfmt
This addresses PR #353 comment #2541522326 which reported that mode validation
was being skipped due to unrecognized 'string' type, reducing coverage to 93%.
Tested with biome-lint action - correctly rejects invalid values and accepts
valid 'check' and 'fix' values.
* docs: update action count from 29 to 30 in CLAUDE.md
Update two references to action count in CLAUDE.md:
- Line 42: repository_overview memory description
- Line 74: Repository Structure section header
The repository has 30 actions total (29 listed + validate-inputs).
Addresses PR #353 comment #2541549588.
* docs: use pinned version ref in language-version-detect README
Change usage example from @main to @v2025 for security best practices.
Using pinned version refs (instead of @main) ensures:
- Predictable behavior across workflow runs
- Protection against breaking changes
- Better security through immutable references
Follows repository convention documented in main README and CLAUDE.md.
Addresses PR #353 comment #2541549588.
* refactor: remove deprecated add-snippets input from codeql-analysis
Remove add-snippets input which has been deprecated by GitHub's CodeQL action
and no longer has any effect.
Changes:
- Remove add-snippets input definition (lines 93-96)
- Remove reference in init step (line 129)
- Remove reference in analyze step (line 211)
- Regenerate README and rules.yml
This is a non-breaking change since:
- Default was 'false' (minimal usage expected)
- GitHub's action already ignores this parameter
- Aligns with recent repository simplification efforts
* feat: add mode_enum validator and update rules
Add mode_enum validator support for lint actions and regenerate all validation rules:
Validator Changes:
- Add mode_enum to action_overrides for biome-lint, eslint-lint, prettier-lint
- Remove deprecated add-snippets from codeql-analysis overrides
Rules Updates:
- All 29 action rules.yml files regenerated with consistent YAML formatting
- biome-lint, eslint-lint, prettier-lint now validate mode input (check/fix)
- Improved coverage for lint actions (79% → 83% for biome, 93% for eslint, 79% for prettier)
Documentation:
- Fix language-version-detect README to use @v2025 (not @main)
- Remove outdated docker-publish security docs (now handled by official actions)
This completes PR #353 review feedback implementation.
* fix: replace bash-specific $'\n' with POSIX-compliant printf
Replace non-POSIX $'\n' syntax in tag building loop with printf-based
approach that works in any POSIX shell.
Changed:
- Line 216: tags="${tags}"$'\n'"${image}:${tag}"
+ Line 216: tags="$(printf '%s\n%s' "$tags" "${image}:${tag}")"
This ensures docker-publish/action.yml runs correctly on systems using
/bin/sh instead of bash.
373 lines
30 KiB
Markdown
373 lines
30 KiB
Markdown
# ivuorinen/actions - My Reusable GitHub Actions and Workflows
|
|
|
|
## Overview
|
|
|
|
This repository contains a collection of reusable GitHub Actions
|
|
designed to streamline CI/CD processes and ensure code quality.
|
|
|
|
Each action is fully self-contained and can be used independently in any GitHub repository.
|
|
|
|
### Key Features
|
|
|
|
- **Production-Ready Actions** covering setup, linting, building, testing, and deployment
|
|
- **Self-Contained Design** - each action works independently without dependencies
|
|
- **External Usage Ready** - use any action with pinned refs: `ivuorinen/actions/action-name@2025-01-15` or `@<commit-sha>` for supply-chain security
|
|
- **Multi-Language Support** including Node.js, PHP, Python, Go, C#, and more
|
|
- **Standardized Patterns** with consistent error handling and input/output interfaces
|
|
- **Comprehensive Testing** with dual testing framework (ShellSpec + pytest)
|
|
- **Modular Build System** using Makefile for development and maintenance
|
|
|
|
<!--LISTING-->
|
|
<!-- This section is auto-generated. Run 'npm run update-catalog' to update. -->
|
|
|
|
## 📚 Action Catalog
|
|
|
|
This repository contains **30 reusable GitHub Actions** for CI/CD automation.
|
|
|
|
### Quick Reference (30 Actions)
|
|
|
|
| Icon | Action | Category | Description | Key Features |
|
|
|:----:|:-----------------------------------------------------|:-----------|:----------------------------------------------------------------|:---------------------------------------------|
|
|
| 🔀 | [`action-versioning`][action-versioning] | Utilities | Automatically update SHA-pinned action references to match l... | Token auth, Outputs |
|
|
| 📦 | [`ansible-lint-fix`][ansible-lint-fix] | Linting | Lints and fixes Ansible playbooks, commits changes, and uplo... | Token auth, Outputs |
|
|
| ✅ | [`biome-lint`][biome-lint] | Linting | Run Biome linter in check or fix mode | Token auth, Outputs |
|
|
| 🛡️ | [`codeql-analysis`][codeql-analysis] | Repository | Run CodeQL security analysis for a single language with conf... | Auto-detection, Token auth, Outputs |
|
|
| 💾 | [`common-cache`][common-cache] | Repository | Standardized caching strategy for all actions | Caching, Outputs |
|
|
| 🖼️ | [`compress-images`][compress-images] | Repository | Compress images on demand (workflow_dispatch), and at 11pm e... | Token auth, Outputs |
|
|
| 📝 | [`csharp-build`][csharp-build] | Build | Builds and tests C# projects. | Auto-detection, Token auth, Outputs |
|
|
| 📝 | [`csharp-lint-check`][csharp-lint-check] | Linting | Runs linters like StyleCop or dotnet-format for C# code styl... | Auto-detection, Token auth, Outputs |
|
|
| 📦 | [`csharp-publish`][csharp-publish] | Publishing | Publishes a C# project to GitHub Packages. | Auto-detection, Token auth, Outputs |
|
|
| 📦 | [`docker-build`][docker-build] | Build | Builds a Docker image for multiple architectures with enhanc... | Caching, Auto-detection, Token auth, Outputs |
|
|
| ☁️ | [`docker-publish`][docker-publish] | Publishing | Simple wrapper to publish Docker images to GitHub Packages a... | Token auth, Outputs |
|
|
| ✅ | [`eslint-lint`][eslint-lint] | Linting | Run ESLint in check or fix mode with advanced configuration ... | Caching, Token auth, Outputs |
|
|
| 📦 | [`go-build`][go-build] | Build | Builds the Go project. | Caching, Auto-detection, Token auth, Outputs |
|
|
| 📝 | [`go-lint`][go-lint] | Linting | Run golangci-lint with advanced configuration, caching, and ... | Caching, Token auth, Outputs |
|
|
| 📝 | [`language-version-detect`][language-version-detect] | Setup | Detects language version from project configuration files wi... | Auto-detection, Token auth, Outputs |
|
|
| 🖥️ | [`node-setup`][node-setup] | Setup | Sets up Node.js environment with version detection and packa... | Auto-detection, Token auth, Outputs |
|
|
| 📦 | [`npm-publish`][npm-publish] | Publishing | Publishes the package to the NPM registry with configurable ... | Token auth, Outputs |
|
|
| 🖥️ | [`php-composer`][php-composer] | Testing | Runs Composer install on a repository with advanced caching ... | Auto-detection, Token auth, Outputs |
|
|
| 💻 | [`php-laravel-phpunit`][php-laravel-phpunit] | Testing | Setup PHP, install dependencies, generate key, create databa... | Auto-detection, Token auth, Outputs |
|
|
| ✅ | [`php-tests`][php-tests] | Testing | Run PHPUnit tests on the repository | Token auth, Outputs |
|
|
| ✅ | [`pr-lint`][pr-lint] | Linting | Runs MegaLinter against pull requests | Caching, Auto-detection, Token auth, Outputs |
|
|
| 📦 | [`pre-commit`][pre-commit] | Linting | Runs pre-commit on the repository and pushes the fixes back ... | Auto-detection, Token auth, Outputs |
|
|
| ✅ | [`prettier-lint`][prettier-lint] | Linting | Run Prettier in check or fix mode with advanced configuratio... | Caching, Token auth, Outputs |
|
|
| 📝 | [`python-lint-fix`][python-lint-fix] | Linting | Lints and fixes Python files, commits changes, and uploads S... | Caching, Auto-detection, Token auth, Outputs |
|
|
| 📦 | [`release-monthly`][release-monthly] | Repository | Creates a release for the current month, incrementing patch ... | Token auth, Outputs |
|
|
| 📦 | [`stale`][stale] | Repository | A GitHub Action to close stale issues and pull requests. | Token auth, Outputs |
|
|
| 🏷️ | [`sync-labels`][sync-labels] | Repository | Sync labels from a YAML file to a GitHub repository | Token auth, Outputs |
|
|
| 🖥️ | [`terraform-lint-fix`][terraform-lint-fix] | Linting | Lints and fixes Terraform files with advanced validation and... | Token auth, Outputs |
|
|
| 🛡️ | [`validate-inputs`][validate-inputs] | Validation | Centralized Python-based input validation for GitHub Actions... | Token auth, Outputs |
|
|
| 📦 | [`version-file-parser`][version-file-parser] | Utilities | Universal parser for common version detection files (.tool-v... | Auto-detection, Outputs |
|
|
|
|
### Actions by Category
|
|
|
|
#### 🔧 Setup (2 actions)
|
|
|
|
| Action | Description | Languages | Features |
|
|
|:--------------------------------------------------------|:------------------------------------------------------|:--------------------------------|:------------------------------------|
|
|
| 📝 [`language-version-detect`][language-version-detect] | Detects language version from project configuratio... | PHP, Python, Go, .NET, Node.js | Auto-detection, Token auth, Outputs |
|
|
| 🖥️ [`node-setup`][node-setup] | Sets up Node.js environment with version detection... | Node.js, JavaScript, TypeScript | Auto-detection, Token auth, Outputs |
|
|
|
|
#### 🛠️ Utilities (2 actions)
|
|
|
|
| Action | Description | Languages | Features |
|
|
|:------------------------------------------------|:------------------------------------------------------|:-------------------|:------------------------|
|
|
| 🔀 [`action-versioning`][action-versioning] | Automatically update SHA-pinned action references ... | GitHub Actions | Token auth, Outputs |
|
|
| 📦 [`version-file-parser`][version-file-parser] | Universal parser for common version detection file... | Multiple Languages | Auto-detection, Outputs |
|
|
|
|
#### 📝 Linting (10 actions)
|
|
|
|
| Action | Description | Languages | Features |
|
|
|:-----------------------------------------------|:------------------------------------------------------|:---------------------------------------------|:---------------------------------------------|
|
|
| 📦 [`ansible-lint-fix`][ansible-lint-fix] | Lints and fixes Ansible playbooks, commits changes... | Ansible, YAML | Token auth, Outputs |
|
|
| ✅ [`biome-lint`][biome-lint] | Run Biome linter in check or fix mode | JavaScript, TypeScript, JSON | Token auth, Outputs |
|
|
| 📝 [`csharp-lint-check`][csharp-lint-check] | Runs linters like StyleCop or dotnet-format for C#... | C#, .NET | Auto-detection, Token auth, Outputs |
|
|
| ✅ [`eslint-lint`][eslint-lint] | Run ESLint in check or fix mode with advanced conf... | JavaScript, TypeScript | Caching, Token auth, Outputs |
|
|
| 📝 [`go-lint`][go-lint] | Run golangci-lint with advanced configuration, cac... | Go | Caching, Token auth, Outputs |
|
|
| ✅ [`pr-lint`][pr-lint] | Runs MegaLinter against pull requests | Conventional Commits | Caching, Auto-detection, Token auth, Outputs |
|
|
| 📦 [`pre-commit`][pre-commit] | Runs pre-commit on the repository and pushes the f... | Python, Multiple Languages | Auto-detection, Token auth, Outputs |
|
|
| ✅ [`prettier-lint`][prettier-lint] | Run Prettier in check or fix mode with advanced co... | JavaScript, TypeScript, Markdown, YAML, JSON | Caching, Token auth, Outputs |
|
|
| 📝 [`python-lint-fix`][python-lint-fix] | Lints and fixes Python files, commits changes, and... | Python | Caching, Auto-detection, Token auth, Outputs |
|
|
| 🖥️ [`terraform-lint-fix`][terraform-lint-fix] | Lints and fixes Terraform files with advanced vali... | Terraform, HCL | Token auth, Outputs |
|
|
|
|
#### 🧪 Testing (3 actions)
|
|
|
|
| Action | Description | Languages | Features |
|
|
|:------------------------------------------------|:------------------------------------------------------|:-------------|:------------------------------------|
|
|
| 🖥️ [`php-composer`][php-composer] | Runs Composer install on a repository with advance... | PHP | Auto-detection, Token auth, Outputs |
|
|
| 💻 [`php-laravel-phpunit`][php-laravel-phpunit] | Setup PHP, install dependencies, generate key, cre... | PHP, Laravel | Auto-detection, Token auth, Outputs |
|
|
| ✅ [`php-tests`][php-tests] | Run PHPUnit tests on the repository | PHP | Token auth, Outputs |
|
|
|
|
#### 🏗️ Build (3 actions)
|
|
|
|
| Action | Description | Languages | Features |
|
|
|:----------------------------------|:------------------------------------------------------|:----------|:---------------------------------------------|
|
|
| 📝 [`csharp-build`][csharp-build] | Builds and tests C# projects. | C#, .NET | Auto-detection, Token auth, Outputs |
|
|
| 📦 [`docker-build`][docker-build] | Builds a Docker image for multiple architectures w... | Docker | Caching, Auto-detection, Token auth, Outputs |
|
|
| 📦 [`go-build`][go-build] | Builds the Go project. | Go | Caching, Auto-detection, Token auth, Outputs |
|
|
|
|
#### 🚀 Publishing (3 actions)
|
|
|
|
| Action | Description | Languages | Features |
|
|
|:--------------------------------------|:------------------------------------------------------|:-------------|:------------------------------------|
|
|
| 📦 [`csharp-publish`][csharp-publish] | Publishes a C# project to GitHub Packages. | C#, .NET | Auto-detection, Token auth, Outputs |
|
|
| ☁️ [`docker-publish`][docker-publish] | Simple wrapper to publish Docker images to GitHub ... | Docker | Token auth, Outputs |
|
|
| 📦 [`npm-publish`][npm-publish] | Publishes the package to the NPM registry with con... | Node.js, npm | Token auth, Outputs |
|
|
|
|
#### 📦 Repository (6 actions)
|
|
|
|
| Action | Description | Languages | Features |
|
|
|:-----------------------------------------|:------------------------------------------------------|:--------------------------------------------------------|:------------------------------------|
|
|
| 🛡️ [`codeql-analysis`][codeql-analysis] | Run CodeQL security analysis for a single language... | JavaScript, TypeScript, Python, Java, C#, C++, Go, Ruby | Auto-detection, Token auth, Outputs |
|
|
| 💾 [`common-cache`][common-cache] | Standardized caching strategy for all actions | Caching | Caching, Outputs |
|
|
| 🖼️ [`compress-images`][compress-images] | Compress images on demand (workflow_dispatch), and... | Images, PNG, JPEG | Token auth, Outputs |
|
|
| 📦 [`release-monthly`][release-monthly] | Creates a release for the current month, increment... | GitHub Actions | Token auth, Outputs |
|
|
| 📦 [`stale`][stale] | A GitHub Action to close stale issues and pull req... | GitHub Actions | Token auth, Outputs |
|
|
| 🏷️ [`sync-labels`][sync-labels] | Sync labels from a YAML file to a GitHub repositor... | YAML, GitHub | Token auth, Outputs |
|
|
|
|
#### ✅ Validation (1 action)
|
|
|
|
| Action | Description | Languages | Features |
|
|
|:-----------------------------------------|:------------------------------------------------------|:---------------------|:--------------------|
|
|
| 🛡️ [`validate-inputs`][validate-inputs] | Centralized Python-based input validation for GitH... | YAML, GitHub Actions | Token auth, Outputs |
|
|
|
|
### Feature Matrix
|
|
|
|
| Action | Caching | Auto-detection | Token auth | Outputs |
|
|
|:-----------------------------------------------------|:-------:|:--------------:|:----------:|:-------:|
|
|
| [`action-versioning`][action-versioning] | - | - | ✅ | ✅ |
|
|
| [`ansible-lint-fix`][ansible-lint-fix] | - | - | ✅ | ✅ |
|
|
| [`biome-lint`][biome-lint] | - | - | ✅ | ✅ |
|
|
| [`codeql-analysis`][codeql-analysis] | - | ✅ | ✅ | ✅ |
|
|
| [`common-cache`][common-cache] | ✅ | - | - | ✅ |
|
|
| [`compress-images`][compress-images] | - | - | ✅ | ✅ |
|
|
| [`csharp-build`][csharp-build] | - | ✅ | ✅ | ✅ |
|
|
| [`csharp-lint-check`][csharp-lint-check] | - | ✅ | ✅ | ✅ |
|
|
| [`csharp-publish`][csharp-publish] | - | ✅ | ✅ | ✅ |
|
|
| [`docker-build`][docker-build] | ✅ | ✅ | ✅ | ✅ |
|
|
| [`docker-publish`][docker-publish] | - | - | ✅ | ✅ |
|
|
| [`eslint-lint`][eslint-lint] | ✅ | - | ✅ | ✅ |
|
|
| [`go-build`][go-build] | ✅ | ✅ | ✅ | ✅ |
|
|
| [`go-lint`][go-lint] | ✅ | - | ✅ | ✅ |
|
|
| [`language-version-detect`][language-version-detect] | - | ✅ | ✅ | ✅ |
|
|
| [`node-setup`][node-setup] | - | ✅ | ✅ | ✅ |
|
|
| [`npm-publish`][npm-publish] | - | - | ✅ | ✅ |
|
|
| [`php-composer`][php-composer] | - | ✅ | ✅ | ✅ |
|
|
| [`php-laravel-phpunit`][php-laravel-phpunit] | - | ✅ | ✅ | ✅ |
|
|
| [`php-tests`][php-tests] | - | - | ✅ | ✅ |
|
|
| [`pr-lint`][pr-lint] | ✅ | ✅ | ✅ | ✅ |
|
|
| [`pre-commit`][pre-commit] | - | ✅ | ✅ | ✅ |
|
|
| [`prettier-lint`][prettier-lint] | ✅ | - | ✅ | ✅ |
|
|
| [`python-lint-fix`][python-lint-fix] | ✅ | ✅ | ✅ | ✅ |
|
|
| [`release-monthly`][release-monthly] | - | - | ✅ | ✅ |
|
|
| [`stale`][stale] | - | - | ✅ | ✅ |
|
|
| [`sync-labels`][sync-labels] | - | - | ✅ | ✅ |
|
|
| [`terraform-lint-fix`][terraform-lint-fix] | - | - | ✅ | ✅ |
|
|
| [`validate-inputs`][validate-inputs] | - | - | ✅ | ✅ |
|
|
| [`version-file-parser`][version-file-parser] | - | ✅ | - | ✅ |
|
|
|
|
### Language Support
|
|
|
|
| Language | Actions |
|
|
|:---------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
| .NET | [`csharp-build`][csharp-build], [`csharp-lint-check`][csharp-lint-check], [`csharp-publish`][csharp-publish], [`language-version-detect`][language-version-detect] |
|
|
| Ansible | [`ansible-lint-fix`][ansible-lint-fix] |
|
|
| C# | [`codeql-analysis`][codeql-analysis], [`csharp-build`][csharp-build], [`csharp-lint-check`][csharp-lint-check], [`csharp-publish`][csharp-publish] |
|
|
| C++ | [`codeql-analysis`][codeql-analysis] |
|
|
| Caching | [`common-cache`][common-cache] |
|
|
| Conventional Commits | [`pr-lint`][pr-lint] |
|
|
| Docker | [`docker-build`][docker-build], [`docker-publish`][docker-publish] |
|
|
| GitHub | [`sync-labels`][sync-labels] |
|
|
| GitHub Actions | [`action-versioning`][action-versioning], [`release-monthly`][release-monthly], [`stale`][stale], [`validate-inputs`][validate-inputs] |
|
|
| Go | [`codeql-analysis`][codeql-analysis], [`go-build`][go-build], [`go-lint`][go-lint], [`language-version-detect`][language-version-detect] |
|
|
| HCL | [`terraform-lint-fix`][terraform-lint-fix] |
|
|
| Images | [`compress-images`][compress-images] |
|
|
| JPEG | [`compress-images`][compress-images] |
|
|
| JSON | [`biome-lint`][biome-lint], [`prettier-lint`][prettier-lint] |
|
|
| Java | [`codeql-analysis`][codeql-analysis] |
|
|
| JavaScript | [`biome-lint`][biome-lint], [`codeql-analysis`][codeql-analysis], [`eslint-lint`][eslint-lint], [`node-setup`][node-setup], [`prettier-lint`][prettier-lint] |
|
|
| Laravel | [`php-laravel-phpunit`][php-laravel-phpunit] |
|
|
| Markdown | [`prettier-lint`][prettier-lint] |
|
|
| Multiple Languages | [`pre-commit`][pre-commit], [`version-file-parser`][version-file-parser] |
|
|
| Node.js | [`language-version-detect`][language-version-detect], [`node-setup`][node-setup], [`npm-publish`][npm-publish] |
|
|
| PHP | [`language-version-detect`][language-version-detect], [`php-composer`][php-composer], [`php-laravel-phpunit`][php-laravel-phpunit], [`php-tests`][php-tests] |
|
|
| PNG | [`compress-images`][compress-images] |
|
|
| Python | [`codeql-analysis`][codeql-analysis], [`language-version-detect`][language-version-detect], [`pre-commit`][pre-commit], [`python-lint-fix`][python-lint-fix] |
|
|
| Ruby | [`codeql-analysis`][codeql-analysis] |
|
|
| Terraform | [`terraform-lint-fix`][terraform-lint-fix] |
|
|
| TypeScript | [`biome-lint`][biome-lint], [`codeql-analysis`][codeql-analysis], [`eslint-lint`][eslint-lint], [`node-setup`][node-setup], [`prettier-lint`][prettier-lint] |
|
|
| YAML | [`ansible-lint-fix`][ansible-lint-fix], [`prettier-lint`][prettier-lint], [`sync-labels`][sync-labels], [`validate-inputs`][validate-inputs] |
|
|
| npm | [`npm-publish`][npm-publish] |
|
|
|
|
### Action Usage
|
|
|
|
All actions can be used independently in your workflows:
|
|
|
|
```yaml
|
|
# Recommended: Use pinned refs for supply-chain security
|
|
- uses: ivuorinen/actions/action-name@vYYYY-MM-DD # Date-based tag (example)
|
|
with:
|
|
# action-specific inputs
|
|
|
|
# Alternative: Use commit SHA for immutability
|
|
- uses: ivuorinen/actions/action-name@abc123def456 # Full commit SHA
|
|
with:
|
|
# action-specific inputs
|
|
```
|
|
|
|
> **Security Note**: Always pin to specific tags or commit SHAs instead of `@main` to ensure reproducible workflows and supply-chain integrity.
|
|
|
|
<!-- Reference Links -->
|
|
|
|
[action-versioning]: action-versioning/README.md
|
|
[ansible-lint-fix]: ansible-lint-fix/README.md
|
|
[biome-lint]: biome-lint/README.md
|
|
[codeql-analysis]: codeql-analysis/README.md
|
|
[common-cache]: common-cache/README.md
|
|
[compress-images]: compress-images/README.md
|
|
[csharp-build]: csharp-build/README.md
|
|
[csharp-lint-check]: csharp-lint-check/README.md
|
|
[csharp-publish]: csharp-publish/README.md
|
|
[docker-build]: docker-build/README.md
|
|
[docker-publish]: docker-publish/README.md
|
|
[eslint-lint]: eslint-lint/README.md
|
|
[go-build]: go-build/README.md
|
|
[go-lint]: go-lint/README.md
|
|
[language-version-detect]: language-version-detect/README.md
|
|
[node-setup]: node-setup/README.md
|
|
[npm-publish]: npm-publish/README.md
|
|
[php-composer]: php-composer/README.md
|
|
[php-laravel-phpunit]: php-laravel-phpunit/README.md
|
|
[php-tests]: php-tests/README.md
|
|
[pr-lint]: pr-lint/README.md
|
|
[pre-commit]: pre-commit/README.md
|
|
[prettier-lint]: prettier-lint/README.md
|
|
[python-lint-fix]: python-lint-fix/README.md
|
|
[release-monthly]: release-monthly/README.md
|
|
[stale]: stale/README.md
|
|
[sync-labels]: sync-labels/README.md
|
|
[terraform-lint-fix]: terraform-lint-fix/README.md
|
|
[validate-inputs]: validate-inputs/README.md
|
|
[version-file-parser]: version-file-parser/README.md
|
|
|
|
---
|
|
|
|
<!--/LISTING-->
|
|
|
|
## Usage
|
|
|
|
### Using Actions Externally
|
|
|
|
All actions in this repository can be used in your workflows like any other GitHub Action.
|
|
|
|
**⚠️ Security Best Practice**: Always pin actions to specific tags or commit SHAs instead of `@main` to ensure:
|
|
|
|
- **Reproducibility**: Workflows behave consistently over time
|
|
- **Supply-chain integrity**: Protection against unexpected changes or compromises
|
|
- **Immutability**: Reference exact versions that cannot be modified
|
|
|
|
```yaml
|
|
steps:
|
|
- name: Setup Node.js with Auto-Detection
|
|
uses: ivuorinen/actions/node-setup@2025-01-15 # Date-based tag
|
|
with:
|
|
default-version: '20'
|
|
|
|
- name: Detect PHP Version
|
|
uses: ivuorinen/actions/php-version-detect@abc123def456 # Commit SHA
|
|
with:
|
|
default-version: '8.2'
|
|
|
|
- name: Universal Version Parser
|
|
uses: ivuorinen/actions/version-file-parser@2025-01-15
|
|
with:
|
|
language: 'python'
|
|
tool-versions-key: 'python'
|
|
dockerfile-image: 'python'
|
|
version-file: '.python-version'
|
|
default-version: '3.12'
|
|
```
|
|
|
|
Actions achieve modularity through composition:
|
|
|
|
```yaml
|
|
steps:
|
|
- name: Parse Version
|
|
id: parse-version
|
|
uses: ivuorinen/actions/version-file-parser@2025-01-15
|
|
with:
|
|
language: 'node'
|
|
tool-versions-key: 'nodejs'
|
|
dockerfile-image: 'node'
|
|
version-file: '.nvmrc'
|
|
default-version: '20'
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@sha
|
|
with:
|
|
node-version: ${{ steps.parse-version.outputs.detected-version }}
|
|
```
|
|
|
|
## Development
|
|
|
|
This repository uses a Makefile-based build system for development tasks:
|
|
|
|
```bash
|
|
# Full workflow - docs, format, and lint
|
|
make all
|
|
|
|
# Individual operations
|
|
make docs # Generate documentation for all actions
|
|
make format # Format all files (markdown, YAML, JSON)
|
|
make lint # Run all linters
|
|
make check # Quick syntax and tool checks
|
|
|
|
# Development workflow
|
|
make dev # Format then lint (good for development)
|
|
make ci # CI workflow - check, docs, lint
|
|
```
|
|
|
|
### Python Development
|
|
|
|
For Python development (validation system), use these specialized commands:
|
|
|
|
```bash
|
|
# Python development workflow
|
|
make dev-python # Format, lint, and test Python code
|
|
make test-python # Run Python unit tests
|
|
make test-python-coverage # Run tests with coverage reporting
|
|
|
|
# Individual Python operations
|
|
make format-python # Format Python files with ruff
|
|
make lint-python # Lint Python files with ruff
|
|
```
|
|
|
|
The Python validation system (`validate-inputs/`) includes:
|
|
|
|
- **CalVer and SemVer Support**: Flexible version validation for different schemes
|
|
- **Comprehensive Test Suite**: Extensive test cases covering all validation types
|
|
- **Security Features**: Command injection and path traversal protection
|
|
- **Performance**: Efficient Python regex engine vs multiple bash processes
|
|
|
|
### Testing
|
|
|
|
```bash
|
|
# Run all tests (Python + GitHub Actions)
|
|
make test
|
|
|
|
# Run specific test types
|
|
make test-python # Python validation tests only
|
|
make test-actions # GitHub Actions tests only
|
|
make test-action ACTION=node-setup # Test specific action
|
|
|
|
# Coverage reporting
|
|
make test-coverage # All tests with coverage
|
|
make test-python-coverage # Python tests with coverage
|
|
```
|
|
|
|
For detailed development guidelines, see [CLAUDE.md](CLAUDE.md).
|
|
|
|
## License
|
|
|
|
This project is licensed under the MIT License. See the [LICENSE](LICENSE.md) file for details.
|