Skip to content

Commit

Permalink
ci: update action docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tagoro9 committed Dec 15, 2023
1 parent e9586a4 commit c9ccc89
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 30 deletions.
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,10 @@ repos:
rev: v1.6.26
hooks:
- id: actionlint
- repo: local
hooks:
- id: update-action-readme
name: update-action-readme
entry: ./script/update-action-readme
language: script
files: '.*action\.yaml$'
58 changes: 28 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# `open-turo/action-setup-tools`

## Description

GitHub Action that installs and provisions supported tools for workflow steps in
self-hosted runners. This relies on the agent having supported tooling
installed.
Expand Down Expand Up @@ -31,40 +29,40 @@ When used with self-hosted runners it's possible to pre-install the tooling you
desire and allow `action-setup-tools` to function as a version check in CI for
much faster workflows.

## Usage
<!-- prettier-ignore-start -->
<!-- action-docs-description -->
## Description

The Action relies on the checked out repository or workspace to have existing
configuration files, for each tool, present in the root level of the repository.
The Action takes no inputs and reads these configuration files, such as
`.node-version`, to configure the tooling correctly for the workflow.
GitHub Action that installs and provisions supported tools for workflow steps in self-hosted runners. This relies on the agent having supported tooling installed.
<!-- action-docs-description -->
<!-- prettier-ignore-end -->

```yaml
name: CI
on:
pull_request:
branches:
- "main"
jobs:
my-job:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup tools
uses: open-turo/action-setup-tools@v1
- name: Output current environment
run: env | sort
```
<!-- prettier-ignore-start -->
<!-- action-docs-inputs -->

<!-- action-docs-inputs -->

<!-- action-docs-outputs -->
## Outputs

| parameter | description |
| --------- | ---------------------------------------------------------------------- |
| go | The version of golang that has been installed and is ready for use. |
| node | The verison of Node.js that has been installed and is ready for use. |
| java | The version of Java that has been installed and is ready for use. |
| python | The version of Python that has been installed and is ready for use. |
| parameter | description |
| --- | --- |
| go | The version of golang that has been installed and is ready for use. |
| node | The verison of Node.js that has been installed and is ready for use. |
| java | The version of Java that has been installed and is ready for use. |
| python | The version of Python that has been installed and is ready for use. |
| terraform | The version of Terraform that has been installed and is ready for use. |
<!-- action-docs-outputs -->

<!-- action-docs-runs -->
## Runs

This action is a `node20` action.
<!-- action-docs-runs -->

<!-- action-docs-usage -->
<!-- action-docs-usage -->
<!-- prettier-ignore-end -->

## Supported Tools

Expand Down
14 changes: 14 additions & 0 deletions script/update-action-readme
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

set -e

for i in $*; do
# ignore if the file does not end with /action.yaml
if [[ "$i" != *"action.yaml" ]]; then
echo "skipping: ${i}"
continue
fi
readme_file=$(dirname "$i")/README.md
echo "npx action-docs --no-banner -a "${i}" --update-readme "${readme_file}""
npx action-docs --no-banner -a "${i}" --update-readme "${readme_file}"
done

0 comments on commit c9ccc89

Please sign in to comment.