Skip to content

Commit

Permalink
docs(prerelease): update usage of action-docs and main README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
yohanb committed Sep 10, 2024
1 parent b733115 commit ffd801e
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 14 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ See usage [here](./release/README.md#usage).

Documentation is found [here](./release/README.md).

### action: [`prerelease`](./prerelease)

Pre-release will perform the same steps as in the [`release`](./release) action but will run [GoReleaser](https://goreleaser.com/) to generate a [snapshot](https://goreleaser.com/customization/snapshots/?h=snapshot) release.

See usage [here](./prerelease/README.md#usage).

Documentation is found [here](./prerelease/README.md).

### action: [`test`](./test)

Executes golang unit tests that exist anywhere within the consumer repository and reports test results and coverage metrics as well. [action-setup-tools](https://github.com/open-turo/action-setup-tools) will be used to install golang, honoring the version information found in the `.go-version` file found in the root level of the consumer repository.
Expand Down
56 changes: 44 additions & 12 deletions prerelease/README.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,70 @@
# GitHub Action Release

<!-- prettier-ignore-start -->
<!-- action-docs-description -->
<!-- action-docs-description source="./prerelease/action.yaml" -->
## Description

GitHub Action that produces a new pre-release (snapshot) of a golang based repository.
<!-- action-docs-description -->
<!-- action-docs-description source="./prerelease/action.yaml" -->
<!-- prettier-ignore-end -->

<!-- prettier-ignore-start -->
<!-- action-docs-inputs -->
<!-- action-docs-inputs source="./prerelease/action.yaml" -->
## Inputs

| parameter | description | required | default |
| name | description | required | default |
| --- | --- | --- | --- |
| checkout-repo | Perform checkout as first step of action | `false` | true |
| github-token | GitHub token that can checkout the consumer repository as well as create tags/releases against it. e.g. 'secrets.GITHUB_TOKEN' | `true` | |
| go-version | Go version to use for building | `true` | 1.17.3 |
<!-- action-docs-inputs -->
| `checkout-repo` | <p>Perform checkout as first step of action</p> | `false` | `true` |
| `github-token` | <p>GitHub token that can checkout the consumer repository as well as create tags/releases against it. e.g. 'secrets.GITHUB_TOKEN'</p> | `true` | `""` |
| `go-version` | <p>Go version to use for building</p> | `true` | `1.17.3` |
| `push-docker-snapshot` | <p>If a docker snapshot image is generated, push it to the to the registry</p> | `false` | `false` |
| `docker-username` | <p>Docker username to push the snapshot image to the registry</p> | `false` | `""` |
| `docker-password` | <p>Docker password to push the snapshot image to the registry</p> | `false` | `""` |
<!-- action-docs-inputs source="./prerelease/action.yaml" -->

<!-- action-docs-outputs -->
<!-- action-docs-outputs source="./prerelease/action.yaml" -->
## Outputs

| name | description |
| --- | --- |
| `version` | <p>Version of the project</p> |
<!-- action-docs-outputs source="./prerelease/action.yaml" -->
## Outputs

| parameter | description |
| --- | --- |
| version | Version of the project |
<!-- action-docs-outputs -->

<!-- action-docs-runs -->
<!-- action-docs-runs source="./prerelease/action.yaml -->
## Runs

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

<!-- action-docs-usage -->
<!-- action-docs-usage -->
## Usage

```yaml
name: Prerelease

on:
pull_request:
types:
- opened
- labeled
- synchronize

jobs:
prerelease:
name: Build and push pre-release image
if: contains(github.event.pull_request.labels.*.name, 'prerelease')
steps:
- name: Pre-release
uses: open-turo/actions-go/prerelease@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
push-docker-snapshot: true
docker-username: ${{ secrets.DOCKER_USERNAME }}
docker-password: ${{ secrets.DOCKER_PASSWORD }}
```
<!-- prettier-ignore-end -->
4 changes: 2 additions & 2 deletions script/update-action-readme
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ for i in $*; do
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}"
echo "npx action-docs --no-banner --source "${i}" --update-readme "${readme_file}""
npx action-docs --no-banner --source "${i}" --update-readme "${readme_file}"
done

0 comments on commit ffd801e

Please sign in to comment.