diff --git a/README.md b/README.md index 8686157..277b494 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/prerelease/README.md b/prerelease/README.md index 3679a0a..4fc2081 100644 --- a/prerelease/README.md +++ b/prerelease/README.md @@ -1,25 +1,34 @@ # GitHub Action Release - + ## Description GitHub Action that produces a new pre-release (snapshot) of a golang based repository. - + - + ## 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 | - +| `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` | +| `push-docker-snapshot` |

If a docker snapshot image is generated, push it to the to the registry

| `false` | `false` | +| `docker-username` |

Docker username to push the snapshot image to the registry

| `false` | `""` | +| `docker-password` |

Docker password to push the snapshot image to the registry

| `false` | `""` | + - + +## Outputs + +| name | description | +| --- | --- | +| `version` |

Version of the project

| + ## Outputs | parameter | description | @@ -27,12 +36,35 @@ GitHub Action that produces a new pre-release (snapshot) of a golang based repos | version | Version of the project | - + ## Runs This action is a `composite` action. - - +## 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 }} +``` diff --git a/script/update-action-readme b/script/update-action-readme index 00247ce..6b39d6d 100755 --- a/script/update-action-readme +++ b/script/update-action-readme @@ -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