Skip to content

Commit 45cfcb3

Browse files
authored
Add action typings with validation (#721)
I'd like to add machine-readable type hints for this action. They also serve as a formal documentation on the types of action's inputs and outputs, which is a standardized way of documenting these also for human users. See https://github.com/typesafegithub/github-actions-typing for details. Dozens of actions already provide typings this way. In particular, this change will let the users of https://github.com/typesafegithub/github-workflows-kt use this action in a convenient, type-safe way from their Kotlin workflows. From the binding service's metrics I see that this action is among the most popular ones that doesn't have typings configured, so on behalf of the users of this tool, I'm asking you to consider adding the typings.
1 parent ce0a899 commit 45cfcb3

2 files changed

Lines changed: 81 additions & 0 deletions

File tree

‎.github/workflows/test.yml‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,6 +1033,15 @@ jobs:
10331033
env:
10341034
GH_TOKEN: ${{ github.token }}
10351035

1036+
validate-typings:
1037+
runs-on: "ubuntu-latest"
1038+
steps:
1039+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
1040+
with:
1041+
persist-credentials: false
1042+
- name: Validate typings
1043+
uses: typesafegithub/github-actions-typing@184d97003b1300f6a10e286eb98c191e416ff02b # v2.2.1
1044+
10361045
all-tests-passed:
10371046
runs-on: ubuntu-latest
10381047
needs:
@@ -1081,6 +1090,7 @@ jobs:
10811090
- test-restore-python-installs
10821091
- test-python-install-dir
10831092
- test-act
1093+
- validate-typings
10841094
if: always()
10851095
steps:
10861096
- name: All tests passed

‎action-types.yml‎

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# See https://github.com/typesafegithub/github-actions-typing
2+
3+
inputs:
4+
version:
5+
type: string
6+
version-file:
7+
type: string
8+
python-version:
9+
type: string
10+
activate-environment:
11+
type: boolean
12+
working-directory:
13+
type: string
14+
checksum:
15+
type: string
16+
github-token:
17+
type: string
18+
enable-cache:
19+
type: enum
20+
allowed-values:
21+
- "true"
22+
- "false"
23+
- auto
24+
cache-dependency-glob:
25+
type: list
26+
separator: "\n"
27+
list-item:
28+
type: string
29+
restore-cache:
30+
type: boolean
31+
save-cache:
32+
type: boolean
33+
cache-suffix:
34+
type: string
35+
cache-local-path:
36+
type: string
37+
prune-cache:
38+
type: boolean
39+
cache-python:
40+
type: boolean
41+
ignore-nothing-to-cache:
42+
type: boolean
43+
ignore-empty-workdir:
44+
type: boolean
45+
tool-dir:
46+
type: string
47+
tool-bin-dir:
48+
type: string
49+
manifest-file:
50+
type: string
51+
add-problem-matchers:
52+
type: boolean
53+
resolution-strategy:
54+
type: enum
55+
allowed-values:
56+
- highest
57+
- lowest
58+
59+
outputs:
60+
uv-version:
61+
type: string
62+
uv-path:
63+
type: string
64+
uvx-path:
65+
type: string
66+
cache-hit:
67+
type: boolean
68+
cache-key:
69+
type: string
70+
venv:
71+
type: string

0 commit comments

Comments
 (0)