mirror of
https://github.com/gradle/actions.git
synced 2026-03-24 21:15:47 +08:00
Add typing information for use by typesafegithub (#814)
Introduces type descriptor YAML files for GitHub Actions in the repository, improving type safety and documentation for action inputs and outputs. It also adds a new GitHub Actions workflow to validate these typings automatically on pushes and pull requests. The changes are grouped into the addition of type descriptor files for various actions and the automation of their validation. https://github.com/typesafegithub/github-actions-typing **Type descriptor files for GitHub Actions:** * Added `action-types.yml` files to `setup-gradle`, `dependency-submission`, and `wrapper-validation` actions, specifying input and output types for each action to improve type safety and documentation. [[1]](diffhunk://#diff-542de74831b6dc1954ff20a4c329b170053c82087ea7df742bd536156133f25bR1-R171) [[2]](diffhunk://#diff-44708a3af3d0f3cfed1873f9b77d7e815c6c14e941fa3dd5ed08835a69d67855R1-R146) [[3]](diffhunk://#diff-3fe1028d7aa5ee815c90fa580d4f62e646f0b9a4b7372f227fc131a56948ace0R1-R17) **Automation and validation:** * Introduced a new GitHub Actions workflow `.github/workflows/ci-validate-typings.yml` to automatically validate action typings on pushes to `main` and `release/**` branches, as well as on pull requests. This uses the `github-actions-typing` action for validation.
This commit is contained in:
committed by
Daz DeBoer
parent
310f24cf39
commit
9e6b5adc6e
19
.github/workflows/ci-validate-typings.yml
vendored
Normal file
19
.github/workflows/ci-validate-typings.yml
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
name: ci-validate-typings.yml
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
- 'release/**'
|
||||
paths-ignore:
|
||||
- 'dist/**'
|
||||
pull_request:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
validate-typings:
|
||||
runs-on: "ubuntu-latest"
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: typesafegithub/github-actions-typing@v2
|
||||
146
dependency-submission/action-types.yml
Normal file
146
dependency-submission/action-types.yml
Normal file
@@ -0,0 +1,146 @@
|
||||
# Type descriptors based on https://github.com/typesafegithub/github-actions-typing
|
||||
inputs:
|
||||
# Gradle execution configuration
|
||||
gradle-version:
|
||||
type: string
|
||||
|
||||
build-root-directory:
|
||||
type: string
|
||||
|
||||
dependency-resolution-task:
|
||||
type: string
|
||||
|
||||
additional-arguments:
|
||||
type: string
|
||||
|
||||
# Cache configuration
|
||||
cache-disabled:
|
||||
type: boolean
|
||||
|
||||
cache-read-only:
|
||||
type: boolean
|
||||
|
||||
cache-write-only:
|
||||
type: boolean
|
||||
|
||||
cache-overwrite-existing:
|
||||
type: boolean
|
||||
|
||||
cache-encryption-key:
|
||||
type: string
|
||||
|
||||
cache-cleanup:
|
||||
type: enum
|
||||
allowed-values:
|
||||
- never
|
||||
- on-success
|
||||
- always
|
||||
|
||||
gradle-home-cache-cleanup:
|
||||
type: boolean
|
||||
|
||||
gradle-home-cache-includes:
|
||||
type: list
|
||||
separator: '\n'
|
||||
list-item:
|
||||
type: string
|
||||
|
||||
gradle-home-cache-excludes:
|
||||
type: list
|
||||
separator: '\n'
|
||||
list-item:
|
||||
type: string
|
||||
|
||||
# Job summary configuration
|
||||
add-job-summary:
|
||||
type: enum
|
||||
allowed-values:
|
||||
- never
|
||||
- always
|
||||
- on-failure
|
||||
|
||||
add-job-summary-as-pr-comment:
|
||||
type: enum
|
||||
allowed-values:
|
||||
- never
|
||||
- always
|
||||
- on-failure
|
||||
|
||||
# Dependency Graph configuration
|
||||
dependency-graph:
|
||||
type: enum
|
||||
allowed-values:
|
||||
- generate-and-submit
|
||||
- generate-submit-and-upload
|
||||
- generate-and-upload
|
||||
- download-and-submit
|
||||
|
||||
dependency-graph-report-dir:
|
||||
type: string
|
||||
|
||||
dependency-graph-continue-on-failure:
|
||||
type: boolean
|
||||
|
||||
dependency-graph-exclude-projects:
|
||||
type: string
|
||||
|
||||
dependency-graph-include-projects:
|
||||
type: string
|
||||
|
||||
dependency-graph-exclude-configurations:
|
||||
type: string
|
||||
|
||||
dependency-graph-include-configurations:
|
||||
type: string
|
||||
|
||||
artifact-retention-days:
|
||||
type: integer
|
||||
|
||||
# Build Scan configuration
|
||||
build-scan-publish:
|
||||
type: boolean
|
||||
|
||||
build-scan-terms-of-use-url:
|
||||
type: enum
|
||||
allowed-values:
|
||||
- https://gradle.com/terms-of-service
|
||||
- https://gradle.com/help/legal-terms-of-use
|
||||
|
||||
build-scan-terms-of-use-agree:
|
||||
type: enum
|
||||
allowed-values:
|
||||
- 'yes'
|
||||
|
||||
develocity-access-key:
|
||||
type: string
|
||||
|
||||
develocity-token-expiry:
|
||||
type: integer
|
||||
|
||||
# Wrapper validation configuration
|
||||
validate-wrappers:
|
||||
type: boolean
|
||||
|
||||
allow-snapshot-wrappers:
|
||||
type: boolean
|
||||
|
||||
# Experimental action inputs
|
||||
gradle-home-cache-strict-match:
|
||||
type: boolean
|
||||
|
||||
# Internal action inputs
|
||||
workflow-job-context:
|
||||
type: string
|
||||
|
||||
github-token:
|
||||
type: string
|
||||
|
||||
outputs:
|
||||
build-scan-url:
|
||||
type: string
|
||||
|
||||
dependency-graph-file:
|
||||
type: string
|
||||
|
||||
gradle-version:
|
||||
type: string
|
||||
171
setup-gradle/action-types.yml
Normal file
171
setup-gradle/action-types.yml
Normal file
@@ -0,0 +1,171 @@
|
||||
# Type descriptors based on https://github.com/typesafegithub/github-actions-typing
|
||||
inputs:
|
||||
gradle-version:
|
||||
type: string
|
||||
|
||||
# Cache configuration
|
||||
cache-disabled:
|
||||
type: boolean
|
||||
|
||||
cache-read-only:
|
||||
type: boolean
|
||||
|
||||
cache-write-only:
|
||||
type: boolean
|
||||
|
||||
cache-overwrite-existing:
|
||||
type: boolean
|
||||
|
||||
cache-encryption-key:
|
||||
type: string
|
||||
|
||||
cache-cleanup:
|
||||
type: enum
|
||||
allowed-values:
|
||||
- never
|
||||
- on-success
|
||||
- always
|
||||
|
||||
gradle-home-cache-cleanup:
|
||||
type: boolean
|
||||
|
||||
gradle-home-cache-includes:
|
||||
type: list
|
||||
separator: '\n'
|
||||
list-item:
|
||||
type: string
|
||||
|
||||
gradle-home-cache-excludes:
|
||||
type: list
|
||||
separator: '\n'
|
||||
list-item:
|
||||
type: string
|
||||
|
||||
# Job summary configuration
|
||||
add-job-summary:
|
||||
type: enum
|
||||
allowed-values:
|
||||
- never
|
||||
- always
|
||||
- on-failure
|
||||
|
||||
add-job-summary-as-pr-comment:
|
||||
type: enum
|
||||
allowed-values:
|
||||
- never
|
||||
- always
|
||||
- on-failure
|
||||
|
||||
# Dependency Graph configuration
|
||||
dependency-graph:
|
||||
type: enum
|
||||
allowed-values:
|
||||
- disabled
|
||||
- generate
|
||||
- generate-and-submit
|
||||
- generate-and-upload
|
||||
- download-and-submit
|
||||
|
||||
dependency-graph-report-dir:
|
||||
type: string
|
||||
|
||||
dependency-graph-continue-on-failure:
|
||||
type: boolean
|
||||
|
||||
dependency-graph-exclude-projects:
|
||||
type: string
|
||||
|
||||
dependency-graph-include-projects:
|
||||
type: string
|
||||
|
||||
dependency-graph-exclude-configurations:
|
||||
type: string
|
||||
|
||||
dependency-graph-include-configurations:
|
||||
type: string
|
||||
|
||||
artifact-retention-days:
|
||||
type: integer
|
||||
|
||||
# Build Scan configuration
|
||||
build-scan-publish:
|
||||
type: boolean
|
||||
|
||||
build-scan-terms-of-use-url:
|
||||
type: enum
|
||||
allowed-values:
|
||||
- https://gradle.com/terms-of-service
|
||||
- https://gradle.com/help/legal-terms-of-use
|
||||
|
||||
build-scan-terms-of-use-agree:
|
||||
type: enum
|
||||
allowed-values:
|
||||
- 'yes'
|
||||
|
||||
develocity-access-key:
|
||||
type: string
|
||||
|
||||
develocity-token-expiry:
|
||||
type: integer
|
||||
|
||||
develocity-injection-enabled:
|
||||
type: boolean
|
||||
|
||||
develocity-url:
|
||||
type: string
|
||||
|
||||
develocity-allow-untrusted-server:
|
||||
type: boolean
|
||||
|
||||
develocity-capture-file-fingerprints:
|
||||
type: boolean
|
||||
|
||||
develocity-enforce-url:
|
||||
type: boolean
|
||||
|
||||
develocity-plugin-version:
|
||||
type: string
|
||||
|
||||
develocity-ccud-plugin-version:
|
||||
type: string
|
||||
|
||||
gradle-plugin-repository-url:
|
||||
type: string
|
||||
|
||||
gradle-plugin-repository-username:
|
||||
type: string
|
||||
|
||||
gradle-plugin-repository-password:
|
||||
type: string
|
||||
|
||||
# Wrapper validation configuration
|
||||
validate-wrappers:
|
||||
type: boolean
|
||||
|
||||
allow-snapshot-wrappers:
|
||||
type: boolean
|
||||
|
||||
# Deprecated action inputs
|
||||
arguments:
|
||||
type: string
|
||||
|
||||
# Experimental action inputs
|
||||
gradle-home-cache-strict-match:
|
||||
type: boolean
|
||||
|
||||
# Internal action inputs
|
||||
workflow-job-context:
|
||||
type: string
|
||||
|
||||
github-token:
|
||||
type: string
|
||||
|
||||
outputs:
|
||||
build-scan-url:
|
||||
type: string
|
||||
|
||||
dependency-graph-file:
|
||||
type: string
|
||||
|
||||
gradle-version:
|
||||
type: string
|
||||
17
wrapper-validation/action-types.yml
Normal file
17
wrapper-validation/action-types.yml
Normal file
@@ -0,0 +1,17 @@
|
||||
# Type descriptors based on https://github.com/typesafegithub/github-actions-typing
|
||||
inputs:
|
||||
min-wrapper-count:
|
||||
type: integer
|
||||
|
||||
allow-snapshots:
|
||||
type: boolean
|
||||
|
||||
allow-checksums:
|
||||
type: list
|
||||
separator: ','
|
||||
list-item:
|
||||
type: string
|
||||
|
||||
outputs:
|
||||
failed-wrapper:
|
||||
type: string
|
||||
Reference in New Issue
Block a user