diff --git a/.commitlintrc.yaml b/.commitlintrc.yaml index 5d2a5ab..d31c511 100644 --- a/.commitlintrc.yaml +++ b/.commitlintrc.yaml @@ -1,2 +1 @@ -extends: - - "@open-turo/commitlint-config-conventional" +extends: ["@open-turo/commitlint-config-conventional"] 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/integration-test/README.md b/integration-test/README.md index d182bbe..50305cf 100644 --- a/integration-test/README.md +++ b/integration-test/README.md @@ -1,6 +1,43 @@ # GitHub Action Integration-Test -GitHub Action that conditionally executes integration tests via docker compose if the docker compose file is present. + + +## Description + +Conditionally executes golang integration tests via docker, if docker compose file is found + + + +## Usage + +```yaml +- uses: @ + with: + checkout-repo: + # Perform checkout as first step of action + # + # Required: false + # Default: true + + github-token: + # GitHub token for docker compose. e.g. 'secrets.GITHUB_TOKEN'. + # + # Required: true + # Default: "" + + docker-compose-file: + # Relative or absolute path to docker-compose.yaml file + # + # Required: false + # Default: ./docker-compose.yaml + + full-compose-output: + # Set this to true to log all container output from docker-compose + # + # Required: false + # Default: false +``` + ## Usage @@ -25,3 +62,4 @@ If the docker compose file is present, the action will run: docker-compose up --build --exit-code-from test test docker-compose down ``` + diff --git a/lint/README.md b/lint/README.md index dd7e16d..9c29bf5 100644 --- a/lint/README.md +++ b/lint/README.md @@ -1,7 +1,11 @@ # GitHub Action Lint - + +## Description + +GitHub Action that lints a Terraform based repository via [action-pre-commit](https://github.com/open-turo/action-pre-commit) + ## Description GitHub Action that lints a Terraform based repository via [action-pre-commit](https://github.com/open-turo/action-pre-commit) @@ -9,7 +13,14 @@ GitHub Action that lints a Terraform based repository via [action-pre-commit](ht - + +## Inputs + +| 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. e.g. 'secrets.GITHUB_TOKEN'

| `true` | `""` | + ## Inputs | parameter | description | required | default | @@ -18,16 +29,22 @@ GitHub Action that lints a Terraform based repository via [action-pre-commit](ht | github-token | GitHub token that can checkout the consumer repository. e.g. 'secrets.GITHUB_TOKEN' | `true` | | - + + + - + +## Runs + +This action is a `composite` action. + ## Runs This action is a `composite` action. - + diff --git a/prerelease/README.md b/prerelease/README.md index 3679a0a..b079b66 100644 --- a/prerelease/README.md +++ b/prerelease/README.md @@ -1,25 +1,34 @@ -# GitHub Action Release +# GitHub Action Pre-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/release/README.md b/release/README.md index 829a19d..59bcd16 100644 --- a/release/README.md +++ b/release/README.md @@ -1,7 +1,11 @@ # GitHub Action Release - + +## Description + +GitHub Action that produces a new Release of a golang based repository. + ## Description GitHub Action that produces a new Release of a golang based repository. @@ -9,7 +13,15 @@ GitHub Action that produces a new Release of a golang based repository. - + +## Inputs + +| 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` | + ## Inputs | parameter | description | required | default | @@ -19,7 +31,13 @@ GitHub Action that produces a new Release of a golang based repository. | go-version | Go version to use for building | `true` | 1.17.3 | - + +## Outputs + +| name | description | +| --- | --- | +| `version` |

Version of the project

| + ## Outputs | parameter | description | @@ -27,12 +45,40 @@ GitHub Action that produces a new Release of a golang based repository. | version | Version of the project | - + +## Runs + +This action is a `composite` action. + ## Runs This action is a `composite` action. - + +## Usage + +```yaml +- uses: @ + with: + checkout-repo: + # Perform checkout as first step of action + # + # Required: false + # Default: true + + github-token: + # GitHub token that can checkout the consumer repository as well as create tags/releases against it. e.g. 'secrets.GITHUB_TOKEN' + # + # Required: true + # Default: "" + + go-version: + # Go version to use for building + # + # Required: true + # Default: 1.17.3 +``` + 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 diff --git a/test/README.md b/test/README.md index b8acbee..f3edc6f 100644 --- a/test/README.md +++ b/test/README.md @@ -1,7 +1,11 @@ # GitHub Action Test - + +## Description + +GitHub Action that executes unit tests present anywhere within a golang based GitHub repository and reports results including coverage metrics + ## Description GitHub Action that executes unit tests present anywhere within a golang based GitHub repository and reports results including coverage metrics @@ -9,25 +13,55 @@ GitHub Action that executes unit tests present anywhere within a golang based Gi - + +## Inputs + +| 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. e.g. 'secrets.GITHUB_TOKEN'

| `true` | `""` | + ## Inputs -| parameter | description | required | default | | --- | --- | --- | --- | | checkout-repo | Perform checkout as first step of action | `false` | true | | github-token | GitHub token that can checkout the consumer repository. e.g. 'secrets.GITHUB_TOKEN' | `true` | | - + + + - + +## Runs + +This action is a `composite` action. + ## Runs This action is a `composite` action. - + +## Usage + +```yaml +- uses: @ + with: + checkout-repo: + # Perform checkout as first step of action + # + # Required: false + # Default: true + + github-token: + # GitHub token that can checkout the consumer repository. e.g. 'secrets.GITHUB_TOKEN' + # + # Required: true + # Default: "" +``` +