-
-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: nitrocode <[email protected]> action-docs: update test Signed-off-by: Rui Chen <[email protected]> use yaml for heredoc delimiters Signed-off-by: Rui Chen <[email protected]>
- Loading branch information
1 parent
f061434
commit fcbf53c
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
class ActionDocs < Formula | ||
desc "Generate docs for GitHub actions" | ||
homepage "https://github.com/npalm/action-docs" | ||
url "https://registry.npmjs.org/action-docs/-/action-docs-2.5.0.tgz" | ||
sha256 "109170e521e4096b571932a6c0af640db48d1d82c3023488c70f0c909787792e" | ||
license "MIT" | ||
|
||
depends_on "node" | ||
|
||
def install | ||
system "npm", "install", *std_npm_args | ||
bin.install_symlink Dir["#{libexec}/bin/*"] | ||
end | ||
|
||
test do | ||
test_file = testpath/"action.yml" | ||
test_file.write <<~YAML | ||
--- | ||
name: "Example name" | ||
description: "Example action description" | ||
author: "Example action author" | ||
inputs: | ||
example: | ||
description: "Example input description" | ||
required: false | ||
runs: | ||
using: "composite" | ||
steps: | ||
- id: random-number-generator | ||
run: echo "random-id=$(echo $RANDOM)" >> $GITHUB_OUTPUT | ||
shell: bash | ||
YAML | ||
|
||
output = shell_output("#{bin}/action-docs --source #{test_file}") | ||
assert_match "Example input description", output | ||
|
||
assert_match version.to_s, shell_output("#{bin}/action-docs --version") | ||
end | ||
end |