-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: modernize action and and lint-release-notes
- Loading branch information
Showing
11 changed files
with
128 additions
and
144 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* @open-turo/github-actions |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": ["github>open-turo/renovate-config#v1"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Update dependencies | ||
concurrency: update-dependencies | ||
|
||
on: | ||
schedule: | ||
# Every day at midnight | ||
- cron: "0 0 * * *" | ||
workflow_dispatch: | ||
issue_comment: | ||
types: | ||
- edited | ||
pull_request: | ||
types: | ||
- edited | ||
|
||
jobs: | ||
update-dependencies: | ||
runs-on: ubuntu-latest | ||
name: Update dependencies | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- uses: open-turo/action-renovate@v1 | ||
with: | ||
github-token: ${{ secrets.OPEN_TURO_GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,30 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.1.0 # Use the ref you want to point at | ||
rev: v4.5.0 # Use the ref you want to point at | ||
hooks: | ||
- id: check-json | ||
- id: check-yaml | ||
- id: pretty-format-json | ||
args: | ||
- --autofix | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
- repo: https://github.com/pre-commit/mirrors-prettier | ||
rev: v2.5.1 | ||
rev: v3.1.0 | ||
hooks: | ||
- id: prettier | ||
stages: [commit] | ||
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook | ||
rev: v8.0.0 | ||
rev: v9.11.0 | ||
hooks: | ||
- id: commitlint | ||
stages: [commit-msg] | ||
additional_dependencies: ["@open-turo/commitlint-config-conventional"] | ||
- repo: https://github.com/rhysd/actionlint | ||
rev: v1.6.8 | ||
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$' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,3 @@ | ||
{ | ||
"branches": [ | ||
"main", | ||
{ | ||
"channel": "next", | ||
"name": "(f|b|c)/*", | ||
"prerelease": "beta-<%= (/^\\w+-\\d+/.exec(name.substr(2)) || [])[0] %>" | ||
} | ||
], | ||
"plugins": [ | ||
"@semantic-release/commit-analyzer", | ||
"@semantic-release/release-notes-generator", | ||
"@semantic-release/github" | ||
] | ||
"extends": "@open-turo/semantic-release-config" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,33 @@ | ||
# GitHub Action Lint | ||
|
||
<!-- prettier-ignore-start --> | ||
<!-- action-docs-description --> | ||
## Description | ||
|
||
GitHub Action that lints a golang based repository via [action-pre-commit](https://github.com/open-turo/action-pre-commit) | ||
|
||
## Usage | ||
|
||
```yaml | ||
jobs: | ||
build: | ||
steps: | ||
- name: Lint | ||
uses: open-turo/actions-go/lint@v1 | ||
with: | ||
## example value for github-token provided below | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
``` | ||
GitHub Action that lints a Terraform based repository via [action-pre-commit](https://github.com/open-turo/action-pre-commit) | ||
<!-- action-docs-description --> | ||
<!-- prettier-ignore-end --> | ||
|
||
<!-- prettier-ignore-start --> | ||
<!-- action-docs-inputs --> | ||
## 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 an `composite` action. | ||
| 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` | | | ||
<!-- action-docs-inputs --> | ||
|
||
## Lint Checks | ||
<!-- action-docs-outputs --> | ||
|
||
This action runs the following lint checks: | ||
<!-- action-docs-outputs --> | ||
|
||
- [action-pre-commit](https://github.com/open-turo/action-pre-commit) | ||
<!-- action-docs-runs --> | ||
## Runs | ||
|
||
## Notes | ||
This action is a `composite` action. | ||
<!-- action-docs-runs --> | ||
|
||
- By default, this action will perform actions/checkout as its first step. | ||
- If the consumer repository has a `package-lock.json`: | ||
- It will execute `npm ci` before running the `pre-commit` step. | ||
- This expects that `.commitlintrc.yaml` will be present at the root level of the consumer repository to enforce [`conventional-commit`](https://github.com/wagoid/commitlint-github-action). | ||
<!-- action-docs-usage --> | ||
<!-- action-docs-usage --> | ||
<!-- prettier-ignore-end --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,69 +1,38 @@ | ||
# GitHub Action Release | ||
|
||
<!-- prettier-ignore-start --> | ||
<!-- action-docs-description --> | ||
## Description | ||
|
||
GitHub Action that produces a new Release of a golang based repository. | ||
<!-- action-docs-description --> | ||
<!-- prettier-ignore-end --> | ||
|
||
## Configuration | ||
|
||
### Step1: Set any [Semantic Release Configuration](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#configuration) in the consumer repository. | ||
|
||
### Step2: [Add Secrets](https://help.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets) in the consumer repository for the [Semantic Release Authentication](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/ci-configuration.md#authentication) Environment Variables. | ||
|
||
### Step3: Add a [Workflow File](https://help.github.com/en/articles/workflow-syntax-for-github-actions) to the consumer repository to create custom automated processes. | ||
|
||
## Usage | ||
|
||
```yaml | ||
steps: | ||
- name: Release | ||
uses: open-turo/actions-go/release@v1 | ||
with: | ||
## example value for github-token provided below | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
``` | ||
**IMPORTANT**: `GITHUB_TOKEN` does not have the required permissions to operate on protected branches. | ||
If you are using this action for protected branches, replace `GITHUB_TOKEN` with [Personal Access Token](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line). If using the `@semantic-release/git` plugin for protected branches, avoid persisting credentials as part of `actions/checkout@v4` by setting the parameter `persist-credentials: false`. This credential does not have the required permission to operate on protected branches. | ||
|
||
<!-- prettier-ignore-start --> | ||
<!-- action-docs-inputs --> | ||
## 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 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 | | ||
| 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 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 --> | ||
|
||
<!-- action-docs-outputs --> | ||
## Outputs | ||
|
||
| parameter | description | | ||
| --------- | ---------------------- | | ||
| version | Version of the project | | ||
| parameter | description | | ||
| --- | --- | | ||
| version | Version of the project | | ||
<!-- action-docs-outputs --> | ||
|
||
<!-- action-docs-runs --> | ||
## Runs | ||
|
||
This action is an `composite` action. | ||
|
||
## Additional Examples | ||
|
||
### using output parameters example | ||
|
||
```yaml | ||
jobs: | ||
build: | ||
steps: | ||
- name: Release | ||
uses: open-turo/actions-go/release@v1 | ||
id: release # Need an `id` for output variables | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Do something when a new release published | ||
if: steps.release.outputs.new-release-published == 'true' | ||
run: | | ||
echo ${{ steps.semantic.outputs.new-release-version }} | ||
echo ${{ steps.semantic.outputs.new-release-major-version }} | ||
``` | ||
## Notes | ||
This action is a `composite` action. | ||
<!-- action-docs-runs --> | ||
|
||
- By default, this action will perform actions/checkout as its first step. | ||
<!-- action-docs-usage --> | ||
<!-- action-docs-usage --> | ||
<!-- prettier-ignore-end --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,33 @@ | ||
# GitHub Action Test | ||
|
||
<!-- prettier-ignore-start --> | ||
<!-- action-docs-description --> | ||
## Description | ||
|
||
GitHub Action that executes unit tests present anywhere within a golang based GitHub repository and reports results including coverage metrics | ||
<!-- action-docs-description --> | ||
<!-- prettier-ignore-end --> | ||
|
||
## Usage | ||
|
||
```yaml | ||
jobs: | ||
test: | ||
steps: | ||
- name: Test | ||
uses: open-turo/actions-go/test@v1 | ||
with: | ||
## example value for github-token provided below | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
``` | ||
<!-- prettier-ignore-start --> | ||
<!-- action-docs-inputs --> | ||
## 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` | | | ||
| 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` | | | ||
<!-- action-docs-inputs --> | ||
|
||
## Runs | ||
<!-- action-docs-outputs --> | ||
|
||
This action is an `composite` action. | ||
<!-- action-docs-outputs --> | ||
|
||
## Test command used | ||
|
||
```shell | ||
go test -cover ./... | ||
``` | ||
<!-- action-docs-runs --> | ||
## Runs | ||
|
||
## Notes | ||
This action is a `composite` action. | ||
<!-- action-docs-runs --> | ||
|
||
- By default, this action will perform actions/checkout as its first step. | ||
<!-- action-docs-usage --> | ||
<!-- action-docs-usage --> | ||
<!-- prettier-ignore-end --> |