Skip to content

Commit

Permalink
action-docs 2.5.0 (new formula)
Browse files Browse the repository at this point in the history
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
nitrocode authored and chenrui333 committed Oct 29, 2024
1 parent f061434 commit fcbf53c
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions Formula/a/action-docs.rb
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

0 comments on commit fcbf53c

Please sign in to comment.