mirror of
https://github.com/ivuorinen/actions.git
synced 2026-02-09 02:45:26 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
81f54fda92 | ||
| a09e59aa7c | |||
| 2d8ff47548 | |||
|
|
a3fb0bd8db | ||
|
|
42312cdbe4 |
4
.github/workflows/test-actions.yml
vendored
4
.github/workflows/test-actions.yml
vendored
@@ -235,8 +235,8 @@ jobs:
|
|||||||
uses: trufflesecurity/trufflehog@0f58ae7c5036094a1e3e750d18772af92821b503
|
uses: trufflesecurity/trufflehog@0f58ae7c5036094a1e3e750d18772af92821b503
|
||||||
with:
|
with:
|
||||||
path: ./
|
path: ./
|
||||||
base: ${{ github.event.repository.default_branch }}
|
base: ${{ github.event_name == 'pull_request' && github.event.repository.default_branch || '' }}
|
||||||
head: HEAD
|
head: ${{ github.event_name == 'pull_request' && 'HEAD' || '' }}
|
||||||
extra_args: --debug --only-verified
|
extra_args: --debug --only-verified
|
||||||
|
|
||||||
- name: Scan shell scripts
|
- name: Scan shell scripts
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ repos:
|
|||||||
types: [markdown, python, yaml]
|
types: [markdown, python, yaml]
|
||||||
files: ^(docs/.*|README\.md|CONTRIBUTING\.md|CHANGELOG\.md|.*\.py|.*\.ya?ml)$
|
files: ^(docs/.*|README\.md|CONTRIBUTING\.md|CHANGELOG\.md|.*\.py|.*\.ya?ml)$
|
||||||
- repo: https://github.com/astral-sh/uv-pre-commit
|
- repo: https://github.com/astral-sh/uv-pre-commit
|
||||||
rev: 0.9.2
|
rev: 0.9.5
|
||||||
hooks:
|
hooks:
|
||||||
- id: uv-lock
|
- id: uv-lock
|
||||||
- id: uv-sync
|
- id: uv-sync
|
||||||
@@ -89,7 +89,7 @@ repos:
|
|||||||
- id: renovate-config-validator
|
- id: renovate-config-validator
|
||||||
|
|
||||||
- repo: https://github.com/bridgecrewio/checkov.git
|
- repo: https://github.com/bridgecrewio/checkov.git
|
||||||
rev: '3.2.483'
|
rev: '3.2.487'
|
||||||
hooks:
|
hooks:
|
||||||
- id: checkov
|
- id: checkov
|
||||||
args:
|
args:
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ runs:
|
|||||||
- name: Validate Inputs (Centralized)
|
- name: Validate Inputs (Centralized)
|
||||||
uses: ivuorinen/actions/validate-inputs@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/validate-inputs@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
||||||
with:
|
with:
|
||||||
action: biome-check
|
action-type: biome-check
|
||||||
|
|
||||||
- name: Validate Inputs (Additional)
|
- name: Validate Inputs (Additional)
|
||||||
id: validate
|
id: validate
|
||||||
|
|||||||
@@ -10,10 +10,10 @@ Publishes the package to the NPM registry with configurable scope and registry U
|
|||||||
|
|
||||||
| name | description | required | default |
|
| name | description | required | default |
|
||||||
|-------------------|----------------------------------------|----------|----------------------------------------|
|
|-------------------|----------------------------------------|----------|----------------------------------------|
|
||||||
|
| `npm_token` | <p>NPM token.</p> | `true` | `""` |
|
||||||
| `registry-url` | <p>Registry URL for publishing.</p> | `false` | `https://registry.npmjs.org/` |
|
| `registry-url` | <p>Registry URL for publishing.</p> | `false` | `https://registry.npmjs.org/` |
|
||||||
| `scope` | <p>Package scope to use.</p> | `false` | `@ivuorinen` |
|
| `scope` | <p>Package scope to use.</p> | `false` | `@ivuorinen` |
|
||||||
| `package-version` | <p>The version to publish.</p> | `false` | `${{ github.event.release.tag_name }}` |
|
| `package-version` | <p>The version to publish.</p> | `false` | `${{ github.event.release.tag_name }}` |
|
||||||
| `npm_token` | <p>NPM token.</p> | `true` | `""` |
|
|
||||||
| `token` | <p>GitHub token for authentication</p> | `false` | `""` |
|
| `token` | <p>GitHub token for authentication</p> | `false` | `""` |
|
||||||
|
|
||||||
### Outputs
|
### Outputs
|
||||||
@@ -33,6 +33,12 @@ This action is a `composite` action.
|
|||||||
```yaml
|
```yaml
|
||||||
- uses: ivuorinen/actions/npm-publish@main
|
- uses: ivuorinen/actions/npm-publish@main
|
||||||
with:
|
with:
|
||||||
|
npm_token:
|
||||||
|
# NPM token.
|
||||||
|
#
|
||||||
|
# Required: true
|
||||||
|
# Default: ""
|
||||||
|
|
||||||
registry-url:
|
registry-url:
|
||||||
# Registry URL for publishing.
|
# Registry URL for publishing.
|
||||||
#
|
#
|
||||||
@@ -51,12 +57,6 @@ This action is a `composite` action.
|
|||||||
# Required: false
|
# Required: false
|
||||||
# Default: ${{ github.event.release.tag_name }}
|
# Default: ${{ github.event.release.tag_name }}
|
||||||
|
|
||||||
npm_token:
|
|
||||||
# NPM token.
|
|
||||||
#
|
|
||||||
# Required: true
|
|
||||||
# Default: ""
|
|
||||||
|
|
||||||
token:
|
token:
|
||||||
# GitHub token for authentication
|
# GitHub token for authentication
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ runs:
|
|||||||
id: validate
|
id: validate
|
||||||
uses: ivuorinen/actions/validate-inputs@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/validate-inputs@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
||||||
with:
|
with:
|
||||||
action: php-composer
|
action-type: php-composer
|
||||||
|
|
||||||
- name: Setup PHP
|
- name: Setup PHP
|
||||||
id: php
|
id: php
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ runs:
|
|||||||
id: validate
|
id: validate
|
||||||
uses: ivuorinen/actions/validate-inputs@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/validate-inputs@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
||||||
with:
|
with:
|
||||||
action: pr-lint
|
action-type: pr-lint
|
||||||
token: ${{ inputs.token }}
|
token: ${{ inputs.token }}
|
||||||
username: ${{ inputs.username }}
|
username: ${{ inputs.username }}
|
||||||
email: ${{ inputs.email }}
|
email: ${{ inputs.email }}
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ runs:
|
|||||||
id: validate
|
id: validate
|
||||||
uses: ivuorinen/actions/validate-inputs@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/validate-inputs@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
||||||
with:
|
with:
|
||||||
action: 'stale'
|
action-type: 'stale'
|
||||||
token: ${{ inputs.token || github.token }}
|
token: ${{ inputs.token || github.token }}
|
||||||
days-before-stale: ${{ inputs.days-before-stale }}
|
days-before-stale: ${{ inputs.days-before-stale }}
|
||||||
days-before-close: ${{ inputs.days-before-close }}
|
days-before-close: ${{ inputs.days-before-close }}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ Centralized Python-based input validation for GitHub Actions with PCRE regex sup
|
|||||||
|
|
||||||
| name | description | required | default |
|
| name | description | required | default |
|
||||||
|---------------------|------------------------------------------------------------------------------------|----------|---------|
|
|---------------------|------------------------------------------------------------------------------------|----------|---------|
|
||||||
| `action` | <p>Action name to validate (alias for action-type)</p> | `true` | `""` |
|
| `action` | <p>Action name to validate (alias for action-type)</p> | `false` | `""` |
|
||||||
| `action-type` | <p>Type of action to validate (e.g., csharp-publish, docker-build, eslint-fix)</p> | `false` | `""` |
|
| `action-type` | <p>Type of action to validate (e.g., csharp-publish, docker-build, eslint-fix)</p> | `false` | `""` |
|
||||||
| `rules-file` | <p>Path to validation rules file</p> | `false` | `""` |
|
| `rules-file` | <p>Path to validation rules file</p> | `false` | `""` |
|
||||||
| `fail-on-error` | <p>Whether to fail on validation errors</p> | `false` | `true` |
|
| `fail-on-error` | <p>Whether to fail on validation errors</p> | `false` | `true` |
|
||||||
@@ -81,7 +81,7 @@ This action is a `composite` action.
|
|||||||
action:
|
action:
|
||||||
# Action name to validate (alias for action-type)
|
# Action name to validate (alias for action-type)
|
||||||
#
|
#
|
||||||
# Required: true
|
# Required: false
|
||||||
# Default: ""
|
# Default: ""
|
||||||
|
|
||||||
action-type:
|
action-type:
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ branding:
|
|||||||
inputs:
|
inputs:
|
||||||
action:
|
action:
|
||||||
description: 'Action name to validate (alias for action-type)'
|
description: 'Action name to validate (alias for action-type)'
|
||||||
required: true
|
required: false
|
||||||
action-type:
|
action-type:
|
||||||
description: 'Type of action to validate (e.g., csharp-publish, docker-build, eslint-fix)'
|
description: 'Type of action to validate (e.g., csharp-publish, docker-build, eslint-fix)'
|
||||||
required: false
|
required: false
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ def collect_inputs() -> dict[str, str]:
|
|||||||
"""
|
"""
|
||||||
inputs = {}
|
inputs = {}
|
||||||
for key, value in os.environ.items():
|
for key, value in os.environ.items():
|
||||||
if key.startswith("INPUT_") and key != "INPUT_ACTION_TYPE":
|
if key.startswith("INPUT_") and key not in ("INPUT_ACTION_TYPE", "INPUT_ACTION"):
|
||||||
input_name = key[6:].lower()
|
input_name = key[6:].lower()
|
||||||
inputs[input_name] = value
|
inputs[input_name] = value
|
||||||
|
|
||||||
@@ -73,8 +73,11 @@ def write_output(status: str, action_type: str, **kwargs) -> None:
|
|||||||
|
|
||||||
def main() -> None:
|
def main() -> None:
|
||||||
"""Main validation entry point."""
|
"""Main validation entry point."""
|
||||||
# Get the action type from environment
|
# Get the action type from environment (check both INPUT_ACTION_TYPE and INPUT_ACTION)
|
||||||
action_type = os.environ.get("INPUT_ACTION_TYPE", "").strip()
|
action_type = (
|
||||||
|
os.environ.get("INPUT_ACTION_TYPE", "").strip()
|
||||||
|
or os.environ.get("INPUT_ACTION", "").strip()
|
||||||
|
)
|
||||||
if not action_type:
|
if not action_type:
|
||||||
logger.error("::error::No action type provided")
|
logger.error("::error::No action type provided")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|||||||
Reference in New Issue
Block a user