Skip to content

Commit f4eb6b5

Browse files
committed
describe checks for branding: section in action.yml
1 parent bfbf83e commit f4eb6b5

File tree

3 files changed

+33
-6
lines changed

3 files changed

+33
-6
lines changed

docs/checks.md

+24-5
Original file line numberDiff line numberDiff line change
@@ -2677,12 +2677,18 @@ jobs:
26772677
Example action metadata:
26782678

26792679
```yaml
2680-
# .github/actions/some-action/action.yml
2680+
# .github/actions/my-invalid-action/action.yml
26812681
26822682
name: 'My action'
26832683
author: '...'
26842684
# ERROR: 'description' section is required
26852685
2686+
branding:
2687+
# ERROR: Invalid icon name
2688+
icon: dog
2689+
# ERROR: Unsupported icon color
2690+
color: black
2691+
26862692
runs:
26872693
# ERROR: Node.js runtime version is too old
26882694
using: 'node14'
@@ -2696,19 +2702,27 @@ runs:
26962702
Output:
26972703

26982704
```
2699-
test.yaml:8:15: description is required in metadata of "My action" action at "path/to/.github/actions/my-invalid-action/action.yml" [action]
2705+
action_metadata_syntax_validation.yaml:8:15: description is required in metadata of "My action" action at "path/to/.github/actions/my-invalid-action/action.yml" [action]
2706+
|
2707+
8 | - uses: ./.github/actions/my-invalid-action
2708+
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2709+
action_metadata_syntax_validation.yaml:8:15: incorrect icon name "dog" at branding.icon in metadata of "My action" action at "path/to/.github/actions/my-invalid-action/action.yml". see the official document to know the exhaustive list of supported icons: https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#brandingicon [action]
2710+
|
2711+
8 | - uses: ./.github/actions/my-invalid-action
2712+
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2713+
action_metadata_syntax_validation.yaml:8:15: incorrect color "black" at branding.icon in metadata of "My action" action at "path/to/.github/actions/my-invalid-action/action.yml". see the official document to know the exhaustive list of supported colors: https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#brandingcolor [action]
27002714
|
27012715
8 | - uses: ./.github/actions/my-invalid-action
27022716
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2703-
test.yaml:8:15: "node14" runner at "runs.using" is unavailable since the Node.js version is too old (14 < 16) in local action "My action" defined at "path/to/.github/actions/my-invalid-action". see https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runs-for-javascript-actions [action]
2717+
action_metadata_syntax_validation.yaml:8:15: invalid runner name "node14" at runs.using in "My action" action defined at "path/to/.github/actions/my-invalid-action". valid runners are "composite", "docker", "node16", and "node20". see https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runs [action]
27042718
|
27052719
8 | - uses: ./.github/actions/my-invalid-action
27062720
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2707-
test.yaml:8:15: file "this-file-does-not-exist.js" does not exist in "path/to/.github/actions/my-invalid-action". it is specified at "main" key in "runs" section in "My action" action [action]
2721+
action_metadata_syntax_validation.yaml:8:15: file "this-file-does-not-exist.js" does not exist in "path/to/.github/actions/my-invalid-action". it is specified at "main" key in "runs" section in "My action" action [action]
27082722
|
27092723
8 | - uses: ./.github/actions/my-invalid-action
27102724
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2711-
test.yaml:8:15: "env" is not allowed in "runs" section because "My action" is a JavaScript action. the action is defined at "path/to/.github/actions/my-invalid-action" [action]
2725+
action_metadata_syntax_validation.yaml:8:15: "env" is not allowed in "runs" section because "My action" is a JavaScript action. the action is defined at "path/to/.github/actions/my-invalid-action" [action]
27122726
|
27132727
8 | - uses: ./.github/actions/my-invalid-action
27142728
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -2724,6 +2738,10 @@ actionlint checks metadata files used in workflows and reports errors when they
27242738
Composite action or JavaScript action (e.g. `image:` is required for Docker action).
27252739
- Files specified in some keys under `runs` are existing. For example, JavaScript action defines a script file path for
27262740
entrypoint at `main:`.
2741+
- Icon name at `icon:` in `branding:` section is correct. Supported icon names are listed in
2742+
[the official document][branding-icons-doc].
2743+
- Icon color at `color:` in `branding:` section is correct. Supported icon colors are white, yellow, blue, green, orange, red,
2744+
purple, or gray-dark.
27272745

27282746
actionlint checks action metadata files which are used by workflows. Currently it is not supported to specify `action.yml`
27292747
directly via command line arguments.
@@ -2784,3 +2802,4 @@ Note that `steps` in Composite action's metadata is not checked at this point. I
27842802
[deprecate-set-env-add-path]: https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/
27852803
[workflow-commands-doc]: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions
27862804
[action-metadata-doc]: https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions
2805+
[branding-icons-doc]: https://github.com/github/docs/blob/main/content/actions/creating-actions/metadata-syntax-for-github-actions.md#exhaustive-list-of-all-currently-supported-icons

testdata/examples/.github/actions/my-invalid-action/action.yml

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1-
# .github/actions/some-action/action.yml
1+
# .github/actions/my-invalid-action/action.yml
22

33
name: 'My action'
44
author: '...'
55
# ERROR: 'description' section is required
66

7+
branding:
8+
# ERROR: Invalid icon name
9+
icon: dog
10+
# ERROR: Unsupported icon color
11+
color: black
12+
713
runs:
814
# ERROR: Node.js runtime version is too old
915
using: 'node14'
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
/test\.yaml:8:15: description is required in metadata of "My action" action at ".+(\\\\|/)my-invalid-action(\\\\|/)action\.yml" \[action\]/
2+
/test\.yaml:8:15: incorrect icon name "dog" at branding\.icon in metadata of "My action" action at ".+(\\\\|/)my-invalid-action(\\\\|/)action\.yml"\. see the official document to know the exhaustive list of supported icons: https://.+ \[action\]/
3+
/test\.yaml:8:15: incorrect color "black" at branding\.icon in metadata of "My action" action at ".+(\\\\|/)my-invalid-action(\\\\|/)action\.yml"\. see the official document to know the exhaustive list of supported colors: https://.+ \[action\]/
24
/test\.yaml:8:15: invalid runner name \"node14\" at runs\.using in \"My action\" action defined at \".+(\\\\|/)actions(\\\\|/)my-invalid-action\"\. valid runners are \"composite\", \"docker\", \"node16\", and \"node20\"\. see https://.+ \[action\]/
35
/test\.yaml:8:15: file "this-file-does-not-exist\.js" does not exist in ".+(\\\\|/)my-invalid-action"\. it is specified at "main" key in "runs" section in "My action" action \[action\]/
46
/test\.yaml:8:15: "env" is not allowed in "runs" section because "My action" is a JavaScript action\. the action is defined at ".+(\\\\|/)my-invalid-action" \[action\]/

0 commit comments

Comments
 (0)