mirror of
https://github.com/ivuorinen/actions.git
synced 2026-02-09 09:45:36 +00:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0fa9a68f07 | |||
| e2222afff1 | |||
|
|
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:
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ runs:
|
|||||||
- name: Cache Python Dependencies
|
- name: Cache Python Dependencies
|
||||||
if: steps.check-files.outputs.files_found == 'true'
|
if: steps.check-files.outputs.files_found == 'true'
|
||||||
id: cache-pip
|
id: cache-pip
|
||||||
uses: ivuorinen/actions/common-cache@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/common-cache@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
with:
|
with:
|
||||||
type: 'pip'
|
type: 'pip'
|
||||||
paths: '~/.cache/pip'
|
paths: '~/.cache/pip'
|
||||||
@@ -122,7 +122,7 @@ runs:
|
|||||||
- name: Install ansible-lint
|
- name: Install ansible-lint
|
||||||
id: install-ansible-lint
|
id: install-ansible-lint
|
||||||
if: steps.check-files.outputs.files_found == 'true'
|
if: steps.check-files.outputs.files_found == 'true'
|
||||||
uses: ivuorinen/actions/common-retry@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/common-retry@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
with:
|
with:
|
||||||
command: 'pip install ansible-lint==6.22.1'
|
command: 'pip install ansible-lint==6.22.1'
|
||||||
max-retries: ${{ inputs.max-retries }}
|
max-retries: ${{ inputs.max-retries }}
|
||||||
@@ -162,7 +162,7 @@ runs:
|
|||||||
- name: Set Git Config for Fixes
|
- name: Set Git Config for Fixes
|
||||||
id: set-git-config
|
id: set-git-config
|
||||||
if: steps.check-files.outputs.files_found == 'true'
|
if: steps.check-files.outputs.files_found == 'true'
|
||||||
uses: ivuorinen/actions/set-git-config@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/set-git-config@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
with:
|
with:
|
||||||
token: ${{ inputs.token }}
|
token: ${{ inputs.token }}
|
||||||
username: ${{ inputs.username }}
|
username: ${{ inputs.username }}
|
||||||
|
|||||||
@@ -44,9 +44,9 @@ runs:
|
|||||||
using: composite
|
using: composite
|
||||||
steps:
|
steps:
|
||||||
- name: Validate Inputs (Centralized)
|
- name: Validate Inputs (Centralized)
|
||||||
uses: ivuorinen/actions/validate-inputs@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/validate-inputs@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
with:
|
with:
|
||||||
action: biome-check
|
action-type: biome-check
|
||||||
|
|
||||||
- name: Validate Inputs (Additional)
|
- name: Validate Inputs (Additional)
|
||||||
id: validate
|
id: validate
|
||||||
@@ -112,7 +112,7 @@ runs:
|
|||||||
token: ${{ inputs.token }}
|
token: ${{ inputs.token }}
|
||||||
|
|
||||||
- name: Set Git Config
|
- name: Set Git Config
|
||||||
uses: ivuorinen/actions/set-git-config@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/set-git-config@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
with:
|
with:
|
||||||
token: ${{ inputs.token }}
|
token: ${{ inputs.token }}
|
||||||
username: ${{ inputs.username }}
|
username: ${{ inputs.username }}
|
||||||
@@ -120,11 +120,11 @@ runs:
|
|||||||
|
|
||||||
- name: Node Setup
|
- name: Node Setup
|
||||||
id: node-setup
|
id: node-setup
|
||||||
uses: ivuorinen/actions/node-setup@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/node-setup@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
|
|
||||||
- name: Cache Node Dependencies
|
- name: Cache Node Dependencies
|
||||||
id: cache
|
id: cache
|
||||||
uses: ivuorinen/actions/common-cache@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/common-cache@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
with:
|
with:
|
||||||
type: 'npm'
|
type: 'npm'
|
||||||
paths: 'node_modules'
|
paths: 'node_modules'
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ runs:
|
|||||||
token: ${{ inputs.token }}
|
token: ${{ inputs.token }}
|
||||||
|
|
||||||
- name: Set Git Config
|
- name: Set Git Config
|
||||||
uses: ivuorinen/actions/set-git-config@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/set-git-config@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
with:
|
with:
|
||||||
token: ${{ inputs.token }}
|
token: ${{ inputs.token }}
|
||||||
username: ${{ inputs.username }}
|
username: ${{ inputs.username }}
|
||||||
@@ -103,11 +103,11 @@ runs:
|
|||||||
|
|
||||||
- name: Node Setup
|
- name: Node Setup
|
||||||
id: node-setup
|
id: node-setup
|
||||||
uses: ivuorinen/actions/node-setup@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/node-setup@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
|
|
||||||
- name: Cache Node Dependencies
|
- name: Cache Node Dependencies
|
||||||
id: cache
|
id: cache
|
||||||
uses: ivuorinen/actions/common-cache@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/common-cache@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
with:
|
with:
|
||||||
type: 'npm'
|
type: 'npm'
|
||||||
paths: 'node_modules'
|
paths: 'node_modules'
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ runs:
|
|||||||
using: composite
|
using: composite
|
||||||
steps:
|
steps:
|
||||||
- name: Validate inputs
|
- name: Validate inputs
|
||||||
uses: ivuorinen/actions/validate-inputs@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/validate-inputs@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
with:
|
with:
|
||||||
action-type: codeql-analysis
|
action-type: codeql-analysis
|
||||||
language: ${{ inputs.language }}
|
language: ${{ inputs.language }}
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ runs:
|
|||||||
fi
|
fi
|
||||||
- name: Set Git Config
|
- name: Set Git Config
|
||||||
id: set-git-config
|
id: set-git-config
|
||||||
uses: ivuorinen/actions/set-git-config@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/set-git-config@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
with:
|
with:
|
||||||
token: ${{ inputs.token }}
|
token: ${{ inputs.token }}
|
||||||
username: ${{ inputs.username }}
|
username: ${{ inputs.username }}
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ runs:
|
|||||||
|
|
||||||
- name: Detect .NET SDK Version
|
- name: Detect .NET SDK Version
|
||||||
id: detect-dotnet-version
|
id: detect-dotnet-version
|
||||||
uses: ivuorinen/actions/dotnet-version-detect@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/dotnet-version-detect@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
with:
|
with:
|
||||||
default-version: "${{ inputs.dotnet-version || '7.0' }}"
|
default-version: "${{ inputs.dotnet-version || '7.0' }}"
|
||||||
|
|
||||||
@@ -61,7 +61,7 @@ runs:
|
|||||||
|
|
||||||
- name: Cache NuGet packages
|
- name: Cache NuGet packages
|
||||||
id: cache-nuget
|
id: cache-nuget
|
||||||
uses: ivuorinen/actions/common-cache@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/common-cache@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
with:
|
with:
|
||||||
type: 'nuget'
|
type: 'nuget'
|
||||||
paths: '~/.nuget/packages'
|
paths: '~/.nuget/packages'
|
||||||
@@ -70,7 +70,7 @@ runs:
|
|||||||
|
|
||||||
- name: Restore Dependencies
|
- name: Restore Dependencies
|
||||||
if: steps.cache-nuget.outputs.cache-hit != 'true'
|
if: steps.cache-nuget.outputs.cache-hit != 'true'
|
||||||
uses: ivuorinen/actions/common-retry@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/common-retry@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
with:
|
with:
|
||||||
command: |
|
command: |
|
||||||
echo "Restoring .NET dependencies..."
|
echo "Restoring .NET dependencies..."
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ runs:
|
|||||||
|
|
||||||
- name: Detect .NET SDK Version
|
- name: Detect .NET SDK Version
|
||||||
id: detect-dotnet-version
|
id: detect-dotnet-version
|
||||||
uses: ivuorinen/actions/dotnet-version-detect@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/dotnet-version-detect@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
with:
|
with:
|
||||||
default-version: ${{ inputs.dotnet-version || '7.0' }}
|
default-version: ${{ inputs.dotnet-version || '7.0' }}
|
||||||
|
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ runs:
|
|||||||
|
|
||||||
- name: Validate Inputs
|
- name: Validate Inputs
|
||||||
id: validate
|
id: validate
|
||||||
uses: ivuorinen/actions/validate-inputs@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/validate-inputs@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
with:
|
with:
|
||||||
action-type: 'csharp-publish'
|
action-type: 'csharp-publish'
|
||||||
token: ${{ inputs.token }}
|
token: ${{ inputs.token }}
|
||||||
@@ -60,7 +60,7 @@ runs:
|
|||||||
|
|
||||||
- name: Detect .NET SDK Version
|
- name: Detect .NET SDK Version
|
||||||
id: detect-dotnet-version
|
id: detect-dotnet-version
|
||||||
uses: ivuorinen/actions/dotnet-version-detect@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/dotnet-version-detect@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
with:
|
with:
|
||||||
default-version: '7.0'
|
default-version: '7.0'
|
||||||
|
|
||||||
@@ -71,7 +71,7 @@ runs:
|
|||||||
|
|
||||||
- name: Cache NuGet packages
|
- name: Cache NuGet packages
|
||||||
id: cache-nuget
|
id: cache-nuget
|
||||||
uses: ivuorinen/actions/common-cache@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/common-cache@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
with:
|
with:
|
||||||
type: 'nuget'
|
type: 'nuget'
|
||||||
paths: '~/.nuget/packages'
|
paths: '~/.nuget/packages'
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ runs:
|
|||||||
|
|
||||||
- name: Validate Inputs
|
- name: Validate Inputs
|
||||||
id: validate
|
id: validate
|
||||||
uses: ivuorinen/actions/validate-inputs@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/validate-inputs@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
with:
|
with:
|
||||||
action-type: 'docker-build'
|
action-type: 'docker-build'
|
||||||
image-name: ${{ inputs.image-name }}
|
image-name: ${{ inputs.image-name }}
|
||||||
|
|||||||
@@ -170,7 +170,7 @@ runs:
|
|||||||
|
|
||||||
- name: Build Multi-Arch Docker Image
|
- name: Build Multi-Arch Docker Image
|
||||||
id: build
|
id: build
|
||||||
uses: ivuorinen/actions/docker-build@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/docker-build@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
with:
|
with:
|
||||||
tag: ${{ steps.tags.outputs.all-tags }}
|
tag: ${{ steps.tags.outputs.all-tags }}
|
||||||
architectures: ${{ inputs.platforms }}
|
architectures: ${{ inputs.platforms }}
|
||||||
@@ -185,7 +185,7 @@ runs:
|
|||||||
- name: Publish to Docker Hub
|
- name: Publish to Docker Hub
|
||||||
id: publish-dockerhub
|
id: publish-dockerhub
|
||||||
if: contains(steps.dest.outputs.reg, 'dockerhub')
|
if: contains(steps.dest.outputs.reg, 'dockerhub')
|
||||||
uses: ivuorinen/actions/docker-publish-hub@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/docker-publish-hub@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
with:
|
with:
|
||||||
tags: ${{ steps.tags.outputs.all-tags }}
|
tags: ${{ steps.tags.outputs.all-tags }}
|
||||||
platforms: ${{ inputs.platforms }}
|
platforms: ${{ inputs.platforms }}
|
||||||
@@ -201,7 +201,7 @@ runs:
|
|||||||
- name: Publish to GitHub Packages
|
- name: Publish to GitHub Packages
|
||||||
id: publish-github
|
id: publish-github
|
||||||
if: contains(steps.dest.outputs.reg, 'github')
|
if: contains(steps.dest.outputs.reg, 'github')
|
||||||
uses: ivuorinen/actions/docker-publish-gh@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/docker-publish-gh@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
with:
|
with:
|
||||||
tags: ${{ steps.tags.outputs.all-tags }}
|
tags: ${{ steps.tags.outputs.all-tags }}
|
||||||
platforms: ${{ inputs.platforms }}
|
platforms: ${{ inputs.platforms }}
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ runs:
|
|||||||
|
|
||||||
- name: Parse .NET Version
|
- name: Parse .NET Version
|
||||||
id: parse-version
|
id: parse-version
|
||||||
uses: ivuorinen/actions/version-file-parser@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/version-file-parser@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
with:
|
with:
|
||||||
language: 'dotnet'
|
language: 'dotnet'
|
||||||
tool-versions-key: 'dotnet'
|
tool-versions-key: 'dotnet'
|
||||||
|
|||||||
@@ -176,11 +176,11 @@ runs:
|
|||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
id: node-setup
|
id: node-setup
|
||||||
uses: ivuorinen/actions/node-setup@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/node-setup@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
|
|
||||||
- name: Cache Node Dependencies
|
- name: Cache Node Dependencies
|
||||||
id: cache
|
id: cache
|
||||||
uses: ivuorinen/actions/common-cache@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/common-cache@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
with:
|
with:
|
||||||
type: 'npm'
|
type: 'npm'
|
||||||
paths: 'node_modules'
|
paths: 'node_modules'
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ runs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Validate Inputs
|
- name: Validate Inputs
|
||||||
id: validate
|
id: validate
|
||||||
uses: ivuorinen/actions/validate-inputs@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/validate-inputs@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
with:
|
with:
|
||||||
action-type: 'eslint-fix'
|
action-type: 'eslint-fix'
|
||||||
token: ${{ inputs.token }}
|
token: ${{ inputs.token }}
|
||||||
@@ -58,7 +58,7 @@ runs:
|
|||||||
token: ${{ inputs.token }}
|
token: ${{ inputs.token }}
|
||||||
|
|
||||||
- name: Set Git Config
|
- name: Set Git Config
|
||||||
uses: ivuorinen/actions/set-git-config@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/set-git-config@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
with:
|
with:
|
||||||
token: ${{ inputs.token }}
|
token: ${{ inputs.token }}
|
||||||
username: ${{ inputs.username }}
|
username: ${{ inputs.username }}
|
||||||
@@ -66,11 +66,11 @@ runs:
|
|||||||
|
|
||||||
- name: Node Setup
|
- name: Node Setup
|
||||||
id: node-setup
|
id: node-setup
|
||||||
uses: ivuorinen/actions/node-setup@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/node-setup@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
|
|
||||||
- name: Cache Node Dependencies
|
- name: Cache Node Dependencies
|
||||||
id: cache
|
id: cache
|
||||||
uses: ivuorinen/actions/common-cache@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/common-cache@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
with:
|
with:
|
||||||
type: 'npm'
|
type: 'npm'
|
||||||
paths: 'node_modules'
|
paths: 'node_modules'
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ runs:
|
|||||||
|
|
||||||
- name: Detect Go Version
|
- name: Detect Go Version
|
||||||
id: detect-go-version
|
id: detect-go-version
|
||||||
uses: ivuorinen/actions/go-version-detect@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/go-version-detect@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
with:
|
with:
|
||||||
default-version: "${{ inputs.go-version || '1.21' }}"
|
default-version: "${{ inputs.go-version || '1.21' }}"
|
||||||
|
|
||||||
@@ -66,7 +66,7 @@ runs:
|
|||||||
|
|
||||||
- name: Cache Go Dependencies
|
- name: Cache Go Dependencies
|
||||||
id: cache-go
|
id: cache-go
|
||||||
uses: ivuorinen/actions/common-cache@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/common-cache@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
with:
|
with:
|
||||||
type: 'go'
|
type: 'go'
|
||||||
paths: '~/go/pkg/mod'
|
paths: '~/go/pkg/mod'
|
||||||
@@ -75,7 +75,7 @@ runs:
|
|||||||
|
|
||||||
- name: Download Dependencies
|
- name: Download Dependencies
|
||||||
if: steps.cache-go.outputs.cache-hit != 'true'
|
if: steps.cache-go.outputs.cache-hit != 'true'
|
||||||
uses: ivuorinen/actions/common-retry@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/common-retry@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
with:
|
with:
|
||||||
command: |
|
command: |
|
||||||
echo "Downloading Go dependencies..."
|
echo "Downloading Go dependencies..."
|
||||||
|
|||||||
@@ -218,7 +218,7 @@ runs:
|
|||||||
- name: Set up Cache
|
- name: Set up Cache
|
||||||
id: cache
|
id: cache
|
||||||
if: inputs.cache == 'true'
|
if: inputs.cache == 'true'
|
||||||
uses: ivuorinen/actions/common-cache@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/common-cache@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
with:
|
with:
|
||||||
type: 'go'
|
type: 'go'
|
||||||
paths: '~/.cache/golangci-lint,~/.cache/go-build'
|
paths: '~/.cache/golangci-lint,~/.cache/go-build'
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ runs:
|
|||||||
|
|
||||||
- name: Parse Go Version
|
- name: Parse Go Version
|
||||||
id: parse-version
|
id: parse-version
|
||||||
uses: ivuorinen/actions/version-file-parser@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/version-file-parser@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
with:
|
with:
|
||||||
language: 'go'
|
language: 'go'
|
||||||
tool-versions-key: 'golang'
|
tool-versions-key: 'golang'
|
||||||
|
|||||||
@@ -176,7 +176,7 @@ runs:
|
|||||||
|
|
||||||
- name: Parse Node.js Version
|
- name: Parse Node.js Version
|
||||||
id: version
|
id: version
|
||||||
uses: ivuorinen/actions/version-file-parser@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/version-file-parser@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
with:
|
with:
|
||||||
language: 'node'
|
language: 'node'
|
||||||
tool-versions-key: 'nodejs'
|
tool-versions-key: 'nodejs'
|
||||||
@@ -299,7 +299,7 @@ runs:
|
|||||||
- name: Cache Dependencies
|
- name: Cache Dependencies
|
||||||
if: inputs.cache == 'true'
|
if: inputs.cache == 'true'
|
||||||
id: deps-cache
|
id: deps-cache
|
||||||
uses: ivuorinen/actions/common-cache@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/common-cache@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
with:
|
with:
|
||||||
type: 'npm'
|
type: 'npm'
|
||||||
paths: '~/.npm,~/.yarn/cache,~/.pnpm-store,~/.bun/install/cache,node_modules'
|
paths: '~/.npm,~/.yarn/cache,~/.pnpm-store,~/.bun/install/cache,node_modules'
|
||||||
@@ -359,7 +359,7 @@ runs:
|
|||||||
|
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
if: inputs.install == 'true' && steps.deps-cache.outputs.cache-hit != 'true'
|
if: inputs.install == 'true' && steps.deps-cache.outputs.cache-hit != 'true'
|
||||||
uses: ivuorinen/actions/common-retry@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/common-retry@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
with:
|
with:
|
||||||
command: |
|
command: |
|
||||||
package_manager="$PACKAGE_MANAGER"
|
package_manager="$PACKAGE_MANAGER"
|
||||||
|
|||||||
@@ -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
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ runs:
|
|||||||
token: ${{ inputs.token || github.token }}
|
token: ${{ inputs.token || github.token }}
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: ivuorinen/actions/node-setup@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/node-setup@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
|
|
||||||
- name: Authenticate NPM
|
- name: Authenticate NPM
|
||||||
shell: sh
|
shell: sh
|
||||||
|
|||||||
@@ -79,9 +79,9 @@ runs:
|
|||||||
|
|
||||||
- name: Validate Inputs
|
- name: Validate Inputs
|
||||||
id: validate
|
id: validate
|
||||||
uses: ivuorinen/actions/validate-inputs@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/validate-inputs@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
with:
|
with:
|
||||||
action: php-composer
|
action-type: php-composer
|
||||||
|
|
||||||
- name: Setup PHP
|
- name: Setup PHP
|
||||||
id: php
|
id: php
|
||||||
@@ -176,7 +176,7 @@ runs:
|
|||||||
|
|
||||||
- name: Cache Composer packages
|
- name: Cache Composer packages
|
||||||
id: composer-cache
|
id: composer-cache
|
||||||
uses: ivuorinen/actions/common-cache@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/common-cache@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
with:
|
with:
|
||||||
type: 'composer'
|
type: 'composer'
|
||||||
paths: vendor,~/.composer/cache${{ inputs.cache-directories != "" && format(",{0}", inputs.cache-directories) || "" }}
|
paths: vendor,~/.composer/cache${{ inputs.cache-directories != "" && format(",{0}", inputs.cache-directories) || "" }}
|
||||||
@@ -196,7 +196,7 @@ runs:
|
|||||||
composer clear-cache
|
composer clear-cache
|
||||||
|
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
uses: ivuorinen/actions/common-retry@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/common-retry@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
with:
|
with:
|
||||||
command: composer install ${{ inputs.args }}
|
command: composer install ${{ inputs.args }}
|
||||||
max-retries: ${{ inputs.max-retries }}
|
max-retries: ${{ inputs.max-retries }}
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ runs:
|
|||||||
|
|
||||||
- name: Detect PHP Version
|
- name: Detect PHP Version
|
||||||
id: php-version
|
id: php-version
|
||||||
uses: ivuorinen/actions/php-version-detect@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/php-version-detect@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
with:
|
with:
|
||||||
default-version: ${{ inputs.php-version }}
|
default-version: ${{ inputs.php-version }}
|
||||||
|
|
||||||
|
|||||||
@@ -86,14 +86,14 @@ runs:
|
|||||||
token: ${{ inputs.token || github.token }}
|
token: ${{ inputs.token || github.token }}
|
||||||
|
|
||||||
- name: Set Git Config
|
- name: Set Git Config
|
||||||
uses: ivuorinen/actions/set-git-config@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/set-git-config@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
with:
|
with:
|
||||||
token: ${{ inputs.token != '' && inputs.token || github.token }}
|
token: ${{ inputs.token != '' && inputs.token || github.token }}
|
||||||
username: ${{ inputs.username }}
|
username: ${{ inputs.username }}
|
||||||
email: ${{ inputs.email }}
|
email: ${{ inputs.email }}
|
||||||
|
|
||||||
- name: Composer Install
|
- name: Composer Install
|
||||||
uses: ivuorinen/actions/php-composer@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/php-composer@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
|
|
||||||
- name: Run PHPUnit Tests
|
- name: Run PHPUnit Tests
|
||||||
id: test
|
id: test
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ runs:
|
|||||||
|
|
||||||
- name: Parse PHP Version
|
- name: Parse PHP Version
|
||||||
id: parse-version
|
id: parse-version
|
||||||
uses: ivuorinen/actions/version-file-parser@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/version-file-parser@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
with:
|
with:
|
||||||
language: 'php'
|
language: 'php'
|
||||||
tool-versions-key: 'php'
|
tool-versions-key: 'php'
|
||||||
|
|||||||
@@ -40,9 +40,9 @@ runs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Validate Inputs
|
- name: Validate Inputs
|
||||||
id: validate
|
id: validate
|
||||||
uses: ivuorinen/actions/validate-inputs@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/validate-inputs@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
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 }}
|
||||||
@@ -64,7 +64,7 @@ runs:
|
|||||||
# ╰──────────────────────────────────────────────────────────╯
|
# ╰──────────────────────────────────────────────────────────╯
|
||||||
- name: Setup Git Config
|
- name: Setup Git Config
|
||||||
id: git-config
|
id: git-config
|
||||||
uses: ivuorinen/actions/set-git-config@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/set-git-config@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
with:
|
with:
|
||||||
token: ${{ inputs.token }}
|
token: ${{ inputs.token }}
|
||||||
username: ${{ inputs.username }}
|
username: ${{ inputs.username }}
|
||||||
@@ -87,7 +87,7 @@ runs:
|
|||||||
|
|
||||||
- name: Setup Node.js environment
|
- name: Setup Node.js environment
|
||||||
if: steps.detect-node.outputs.found == 'true'
|
if: steps.detect-node.outputs.found == 'true'
|
||||||
uses: ivuorinen/actions/node-setup@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/node-setup@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
with:
|
with:
|
||||||
install: true
|
install: true
|
||||||
cache: true
|
cache: true
|
||||||
@@ -106,7 +106,7 @@ runs:
|
|||||||
- name: Detect PHP Version
|
- name: Detect PHP Version
|
||||||
if: steps.detect-php.outputs.found == 'true'
|
if: steps.detect-php.outputs.found == 'true'
|
||||||
id: php-version
|
id: php-version
|
||||||
uses: ivuorinen/actions/php-version-detect@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/php-version-detect@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
|
|
||||||
- name: Setup PHP
|
- name: Setup PHP
|
||||||
if: steps.detect-php.outputs.found == 'true'
|
if: steps.detect-php.outputs.found == 'true'
|
||||||
@@ -150,7 +150,7 @@ runs:
|
|||||||
- name: Detect Python Version
|
- name: Detect Python Version
|
||||||
if: steps.detect-python.outputs.found == 'true'
|
if: steps.detect-python.outputs.found == 'true'
|
||||||
id: python-version
|
id: python-version
|
||||||
uses: ivuorinen/actions/python-version-detect@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/python-version-detect@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
|
|
||||||
- name: Setup Python
|
- name: Setup Python
|
||||||
if: steps.detect-python.outputs.found == 'true'
|
if: steps.detect-python.outputs.found == 'true'
|
||||||
@@ -181,7 +181,7 @@ runs:
|
|||||||
- name: Detect Go Version
|
- name: Detect Go Version
|
||||||
if: steps.detect-go.outputs.found == 'true'
|
if: steps.detect-go.outputs.found == 'true'
|
||||||
id: go-version
|
id: go-version
|
||||||
uses: ivuorinen/actions/go-version-detect@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/go-version-detect@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
|
|
||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
if: steps.detect-go.outputs.found == 'true'
|
if: steps.detect-go.outputs.found == 'true'
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ runs:
|
|||||||
|
|
||||||
- name: Validate Inputs
|
- name: Validate Inputs
|
||||||
id: validate
|
id: validate
|
||||||
uses: ivuorinen/actions/validate-inputs@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/validate-inputs@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
with:
|
with:
|
||||||
action-type: 'pre-commit'
|
action-type: 'pre-commit'
|
||||||
token: ${{ inputs.token }}
|
token: ${{ inputs.token }}
|
||||||
@@ -58,7 +58,7 @@ runs:
|
|||||||
email: ${{ inputs.commit_email }}
|
email: ${{ inputs.commit_email }}
|
||||||
username: ${{ inputs.commit_user }}
|
username: ${{ inputs.commit_user }}
|
||||||
- name: Set Git Config
|
- name: Set Git Config
|
||||||
uses: ivuorinen/actions/set-git-config@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/set-git-config@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
with:
|
with:
|
||||||
token: ${{ inputs.token }}
|
token: ${{ inputs.token }}
|
||||||
username: ${{ inputs.commit_user }}
|
username: ${{ inputs.commit_user }}
|
||||||
|
|||||||
@@ -202,11 +202,11 @@ runs:
|
|||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
id: node-setup
|
id: node-setup
|
||||||
uses: ivuorinen/actions/node-setup@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/node-setup@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
|
|
||||||
- name: Set up Cache
|
- name: Set up Cache
|
||||||
id: cache
|
id: cache
|
||||||
uses: ivuorinen/actions/common-cache@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/common-cache@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
if: inputs.cache == 'true'
|
if: inputs.cache == 'true'
|
||||||
with:
|
with:
|
||||||
type: 'npm'
|
type: 'npm'
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ runs:
|
|||||||
token: ${{ inputs.token }}
|
token: ${{ inputs.token }}
|
||||||
|
|
||||||
- name: Set Git Config
|
- name: Set Git Config
|
||||||
uses: ivuorinen/actions/set-git-config@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/set-git-config@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
with:
|
with:
|
||||||
token: ${{ inputs.token }}
|
token: ${{ inputs.token }}
|
||||||
username: ${{ inputs.username }}
|
username: ${{ inputs.username }}
|
||||||
@@ -99,11 +99,11 @@ runs:
|
|||||||
|
|
||||||
- name: Node Setup
|
- name: Node Setup
|
||||||
id: node-setup
|
id: node-setup
|
||||||
uses: ivuorinen/actions/node-setup@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/node-setup@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
|
|
||||||
- name: Cache npm Dependencies
|
- name: Cache npm Dependencies
|
||||||
id: cache-npm
|
id: cache-npm
|
||||||
uses: ivuorinen/actions/common-cache@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/common-cache@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
with:
|
with:
|
||||||
type: 'npm'
|
type: 'npm'
|
||||||
paths: 'node_modules'
|
paths: 'node_modules'
|
||||||
|
|||||||
@@ -155,7 +155,7 @@ runs:
|
|||||||
|
|
||||||
- name: Detect Python Version
|
- name: Detect Python Version
|
||||||
id: python-version
|
id: python-version
|
||||||
uses: ivuorinen/actions/python-version-detect@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/python-version-detect@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
with:
|
with:
|
||||||
default-version: ${{ inputs.python-version }}
|
default-version: ${{ inputs.python-version }}
|
||||||
|
|
||||||
@@ -189,7 +189,7 @@ runs:
|
|||||||
- name: Cache Python Dependencies
|
- name: Cache Python Dependencies
|
||||||
if: steps.check-files.outputs.result == 'found'
|
if: steps.check-files.outputs.result == 'found'
|
||||||
id: cache-pip
|
id: cache-pip
|
||||||
uses: ivuorinen/actions/common-cache@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/common-cache@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
with:
|
with:
|
||||||
type: 'pip'
|
type: 'pip'
|
||||||
paths: '~/.cache/pip'
|
paths: '~/.cache/pip'
|
||||||
@@ -325,7 +325,7 @@ runs:
|
|||||||
|
|
||||||
- name: Set Git Config for Fixes
|
- name: Set Git Config for Fixes
|
||||||
if: ${{ fromJSON(steps.fix.outputs.fixed_count) > 0 }}
|
if: ${{ fromJSON(steps.fix.outputs.fixed_count) > 0 }}
|
||||||
uses: ivuorinen/actions/set-git-config@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/set-git-config@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
with:
|
with:
|
||||||
token: ${{ inputs.token }}
|
token: ${{ inputs.token }}
|
||||||
username: ${{ inputs.username }}
|
username: ${{ inputs.username }}
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ runs:
|
|||||||
|
|
||||||
- name: Parse Python Version
|
- name: Parse Python Version
|
||||||
id: parse-version
|
id: parse-version
|
||||||
uses: ivuorinen/actions/version-file-parser@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/version-file-parser@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
with:
|
with:
|
||||||
language: 'python'
|
language: 'python'
|
||||||
tool-versions-key: 'python'
|
tool-versions-key: 'python'
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ runs:
|
|||||||
|
|
||||||
- name: Parse Python Version
|
- name: Parse Python Version
|
||||||
id: parse-version
|
id: parse-version
|
||||||
uses: ivuorinen/actions/version-file-parser@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/version-file-parser@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
with:
|
with:
|
||||||
language: 'python'
|
language: 'python'
|
||||||
tool-versions-key: 'python'
|
tool-versions-key: 'python'
|
||||||
|
|||||||
@@ -43,9 +43,9 @@ runs:
|
|||||||
|
|
||||||
- name: Validate Inputs
|
- name: Validate Inputs
|
||||||
id: validate
|
id: validate
|
||||||
uses: ivuorinen/actions/validate-inputs@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/validate-inputs@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
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 }}
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ runs:
|
|||||||
|
|
||||||
- name: Validate Inputs
|
- name: Validate Inputs
|
||||||
id: validate
|
id: validate
|
||||||
uses: ivuorinen/actions/validate-inputs@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/validate-inputs@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
with:
|
with:
|
||||||
action-type: 'terraform-lint-fix'
|
action-type: 'terraform-lint-fix'
|
||||||
token: ${{ inputs.token || github.token }}
|
token: ${{ inputs.token || github.token }}
|
||||||
@@ -270,7 +270,7 @@ runs:
|
|||||||
|
|
||||||
- name: Set Git Config for Fixes
|
- name: Set Git Config for Fixes
|
||||||
if: ${{ fromJSON(steps.fix.outputs.fixed_count) > 0 }}
|
if: ${{ fromJSON(steps.fix.outputs.fixed_count) > 0 }}
|
||||||
uses: ivuorinen/actions/set-git-config@7061aafd35a2f21b57653e34f2b634b2a19334a9
|
uses: ivuorinen/actions/set-git-config@e2222afff180ee77f330ef4325f60d6e85477c01
|
||||||
with:
|
with:
|
||||||
token: ${{ inputs.token || github.token }}
|
token: ${{ inputs.token || github.token }}
|
||||||
username: ${{ inputs.username }}
|
username: ${{ inputs.username }}
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
@@ -285,6 +285,8 @@ class ConventionBasedValidator(BaseValidator):
|
|||||||
# Get conventions and overrides from rules
|
# Get conventions and overrides from rules
|
||||||
conventions = self._rules.get("conventions", {})
|
conventions = self._rules.get("conventions", {})
|
||||||
overrides = self._rules.get("overrides", {})
|
overrides = self._rules.get("overrides", {})
|
||||||
|
optional_inputs = self._rules.get("optional_inputs", {})
|
||||||
|
required_inputs = self.get_required_inputs()
|
||||||
|
|
||||||
# Validate each input
|
# Validate each input
|
||||||
for input_name, value in inputs.items():
|
for input_name, value in inputs.items():
|
||||||
@@ -292,12 +294,28 @@ class ConventionBasedValidator(BaseValidator):
|
|||||||
if input_name in overrides and overrides[input_name] is None:
|
if input_name in overrides and overrides[input_name] is None:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
# Check if input is defined in the action's rules
|
||||||
|
is_defined_input = (
|
||||||
|
input_name in required_inputs
|
||||||
|
or input_name in optional_inputs
|
||||||
|
or input_name in conventions
|
||||||
|
or input_name in overrides
|
||||||
|
)
|
||||||
|
|
||||||
|
# Skip validation for undefined inputs with empty values
|
||||||
|
# This prevents auto-validation of irrelevant inputs from the
|
||||||
|
# validate-inputs action's own input list
|
||||||
|
if not is_defined_input and (
|
||||||
|
not value or (isinstance(value, str) and not value.strip())
|
||||||
|
):
|
||||||
|
continue
|
||||||
|
|
||||||
# Get validator type from overrides or conventions
|
# Get validator type from overrides or conventions
|
||||||
validator_type = self._get_validator_type(input_name, conventions, overrides)
|
validator_type = self._get_validator_type(input_name, conventions, overrides)
|
||||||
|
|
||||||
if validator_type:
|
if validator_type:
|
||||||
# Check if this is a required input
|
# Check if this is a required input
|
||||||
is_required = input_name in self.get_required_inputs()
|
is_required = input_name in required_inputs
|
||||||
valid &= self._apply_validator(
|
valid &= self._apply_validator(
|
||||||
input_name, value, validator_type, is_required=is_required
|
input_name, value, validator_type, is_required=is_required
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user