diff --git a/Formula/a/action-docs.rb b/Formula/a/action-docs.rb new file mode 100644 index 00000000000000..3e154d344e42df --- /dev/null +++ b/Formula/a/action-docs.rb @@ -0,0 +1,35 @@ +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 + (testpath/"action.yml").write <<~EOT + --- + 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 + EOT + + assert_match "Example input description", shell_output(bin/"action-docs") + end +end