Skip to content

Commit 5a5091e

Browse files
Copilotfriggeri
andcommitted
Fix composite action outputs and step references
Co-authored-by: friggeri <106686+friggeri@users.noreply.github.com>
1 parent 44c8edf commit 5a5091e

12 files changed

Lines changed: 4082 additions & 3 deletions

File tree

.github/actions/setup-copilot/action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: "Setup Copilot"
22
description: "Setup Copilot based on the project's package.json file."
3+
outputs:
4+
cli-path:
5+
description: "Path to the Copilot CLI"
6+
value: ${{ steps.cli-path.outputs.path }}
37
runs:
48
using: "composite"
59
steps:

.github/workflows/sdk-e2e-tests.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ jobs:
6666
cache-dependency-path: "./nodejs/package-lock.json"
6767
node-version: 22
6868
- uses: ./.github/actions/setup-copilot
69+
id: setup-copilot
6970
- name: Install dependencies
7071
run: npm ci --ignore-scripts
7172

@@ -90,7 +91,7 @@ jobs:
9091
- name: Run Node.js SDK tests
9192
env:
9293
COPILOT_HMAC_KEY: ${{ secrets.COPILOT_DEVELOPER_CLI_INTEGRATION_HMAC_KEY }}
93-
COPILOT_CLI_PATH: ${{ steps.cli-path.outputs.path }}
94+
COPILOT_CLI_PATH: ${{ steps.setup-copilot.outputs.cli-path }}
9495
run: npm test
9596

9697
go-sdk:
@@ -110,6 +111,7 @@ jobs:
110111
steps:
111112
- uses: actions/checkout@v6.0.2
112113
- uses: ./.github/actions/setup-copilot
114+
id: setup-copilot
113115
- uses: actions/setup-go@v6
114116
with:
115117
go-version: "1.23"
@@ -145,7 +147,7 @@ jobs:
145147
- name: Run Go SDK tests
146148
env:
147149
COPILOT_HMAC_KEY: ${{ secrets.COPILOT_DEVELOPER_CLI_INTEGRATION_HMAC_KEY }}
148-
COPILOT_CLI_PATH: ${{ steps.cli-path.outputs.path }}
150+
COPILOT_CLI_PATH: ${{ steps.setup-copilot.outputs.cli-path }}
149151
run: /bin/bash test.sh
150152

151153
python-sdk:
@@ -165,6 +167,7 @@ jobs:
165167
steps:
166168
- uses: actions/checkout@v6.0.2
167169
- uses: ./.github/actions/setup-copilot
170+
id: setup-copilot
168171
- uses: actions/setup-python@v6
169172
with:
170173
python-version: "3.12"
@@ -197,7 +200,7 @@ jobs:
197200
- name: Run Python SDK tests
198201
env:
199202
COPILOT_HMAC_KEY: ${{ secrets.COPILOT_DEVELOPER_CLI_INTEGRATION_HMAC_KEY }}
200-
COPILOT_CLI_PATH: ${{ steps.cli-path.outputs.path }}
203+
COPILOT_CLI_PATH: ${{ steps.setup-copilot.outputs.cli-path }}
201204
run: uv run pytest -v -s
202205

203206
dotnet-sdk:
@@ -217,6 +220,7 @@ jobs:
217220
steps:
218221
- uses: actions/checkout@v6.0.2
219222
- uses: ./.github/actions/setup-copilot
223+
id: setup-copilot
220224
- uses: actions/setup-dotnet@v5
221225
with:
222226
dotnet-version: "8.0.x"

LICENSE.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
the MIT License
2+
3+
Copyright (c) 2021 rhysd
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
9+
of the Software, and to permit persons to whom the Software is furnished to do so,
10+
subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
16+
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
17+
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
20+
THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21+

actionlint

4.87 MB
Binary file not shown.

docs/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Documents
2+
=========
3+
4+
- [Checks](checks.md): Full list of all checks done by actionlint with example inputs, outputs, and playground links.
5+
- [Installation](install.md): Installation instructions. Prebuilt binaries, Homebrew package, a Docker image, building from
6+
source, a download script (for CI) are available.
7+
- [Usage](usage.md): How to use `actionlint` command locally or on GitHub Actions, the online playground, an official Docker
8+
image, and integrations with reviewdog, Problem Matchers, super-linter, pre-commit.
9+
- [Configuration](config.md): How to configure actionlint behavior. Currently, only labels of self-hosted runners can be
10+
configured.
11+
- [Go API](api.md): How to use actionlint as Go library.
12+
- [References](reference.md): Links to resources.

docs/api.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
Go API
2+
======
3+
[![API Document][api-badge]][apidoc]
4+
5+
This document describes how to use [actionlint](..) as Go library.
6+
7+
actionlint can be used from Go programs by importing the module.
8+
9+
```go
10+
import "github.com/rhysd/actionlint"
11+
```
12+
13+
See [the documentation][apidoc] to know the list of all APIs. It contains
14+
a workflow file parser built on top of `go-yaml/yaml`, expression `${{ }}` lexer/parser/checker, etc.
15+
16+
Followings are unexhaustive list of interesting APIs.
17+
18+
- `Command` struct represents entire `actionlint` command. `Command.Main` takes command line arguments and runs command
19+
until the end and returns exit status.
20+
- `Linter` manages linter lifecycle and applies checks to given files. If you want to run actionlint checks in your
21+
program, please use this struct.
22+
- `Project` and `Projects` detect a project (Git repository) in a given directory path and find configuration in it.
23+
- `Config` represents structure of `actionlint.yaml` config file. It can be decoded by [go-yaml/yaml][go-yaml] library.
24+
- `Workflow`, `Job`, `Step`, ... are nodes of workflow syntax tree. `Workflow` is a root node.
25+
- `Parse()` parses given contents into a workflow syntax tree. It tries to find syntax errors as much as possible and
26+
returns found errors as slice.
27+
- `Pass` is a visitor to traverse a workflow syntax tree. Multiple passes can be applied at single pass using `Visitor`.
28+
- `Rule` is an interface for rule checkers and `RuneBase` is a base struct to implement a rule checker.
29+
- `RuleExpression` is a rule checker to check expression syntax in `${{ }}`.
30+
- `RuleShellcheck` is a rule checker to apply `shellcheck` command to `run:` sections and collect errors from it.
31+
- `RuleJobNeeds` is a rule checker to check dependencies in `needs:` section. It can detect cyclic dependencies.
32+
- ...
33+
- `ExprLexer` lexes expression syntax in `${{ }}` and returns slice of `Token`.
34+
- `ExprParser` parses given slice of `Token` and returns syntax tree for expression in `${{ }}`. `ExprNode` is an
35+
interface for nodes in the expression syntax tree.
36+
- `ExprType` is an interface of types in expression syntax `${{ }}`. `ObjectType`, `ArrayType`, `StringType`,
37+
`NumberType`, ... are structs to represent actual types of expression.
38+
- `ExprSemanticsChecker` checks semantics of expression syntax `${{ }}`. It traverses given expression syntax tree and
39+
deduces its type, checking types and resolving variables (contexts).
40+
- `ValidateRefGlob()` and `ValidatePathGlob()` validate [glob filter pattern][filter-pattern-doc] and returns all errors
41+
found by the validator.
42+
- `ActionMetadata` is a struct for action metadata file (`action.yml`). It is used to check inputs specified at `with:`
43+
and typing `steps.{id}.outputs` object strictly.
44+
- `PopularActions` global variable is the data set of popular actions' metadata collected by [the script](../scripts/generate-popular-actions).
45+
- `AllWebhookTypes` global variable is the mapping from all webhook names to their types collected by [the script](../scripts/generate-webhook-events).
46+
- `WorkflowKeyAvailability()` returns available context names and special function names for the given workflow key like
47+
`jobs.<job_id>.outputs.<output_id>`. This function uses the data collected by [the script](../scripts/generate-availability).
48+
49+
## Library versioning
50+
51+
The version of this repository is for command line tool `actionlint`. So it does not represent the version of the library.
52+
It means that the library does not follow semantic versioning and any patch version bump may introduce some breaking changes.
53+
54+
## Go version compatibility
55+
56+
Minimum supported Go version is written in [`go.mod`](../go.mod) file in this repository. That said, older Go versions are
57+
actually not tested on CI. Last two major Go versions are recommended because they're tested on CI. For example, when the latest
58+
Go version is v1.22, v1.21 and v1.22 are nice to use.
59+
60+
---
61+
62+
[Checks](checks.md) | [Installation](install.md) | [Usage](usage.md) | [Configuration](config.md) | [References](reference.md)
63+
64+
[api-badge]: https://pkg.go.dev/badge/github.com/rhysd/actionlint.svg
65+
[apidoc]: https://pkg.go.dev/github.com/rhysd/actionlint
66+
[go-yaml]: https://github.com/go-yaml/yaml
67+
[filter-pattern-doc]: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet

0 commit comments

Comments
 (0)