-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e1b62dd
commit a045ccd
Showing
5 changed files
with
61 additions
and
2 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 @@ | ||
* @Jerome1337 |
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,5 @@ | ||
FROM cytopia/golint | ||
|
||
COPY entrypoint.sh /entrypoint.sh | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] |
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,2 +1,23 @@ | ||
# golint-action | ||
Ready to use go lint GitHub action | ||
# Golint action | ||
|
||
This action execute golint command and return the output if the command fail. | ||
|
||
## Inputs | ||
|
||
### `golint-path` | ||
|
||
Path used by golint command, default is `./...`. | ||
|
||
## Outputs | ||
|
||
### `golint-output` | ||
|
||
The golint output if the command fail. | ||
|
||
## Example usage | ||
|
||
```yaml | ||
uses: Jerome1337/go-action/lint@v1.0.0 | ||
with: | ||
golint-path: './src/...' | ||
```` |
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,19 @@ | ||
name: 'Go-linter' | ||
author: 'Jérôme Pogeant' | ||
description: 'Lint your code using golint' | ||
inputs: | ||
golint-path: | ||
description: 'Path used by golint command' | ||
required: false | ||
default: './...' | ||
outputs: | ||
golint-output: | ||
description: 'The golint output if the command fail' | ||
runs: | ||
using: 'docker' | ||
image: 'Dockerfile' | ||
args: | ||
- ${{ inputs.golint-path }} | ||
branding: | ||
icon: 'check-circle' | ||
color: 'green' |
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,13 @@ | ||
#!/bin/sh -l | ||
|
||
cd $GITHUB_WORKSPACE | ||
|
||
GOLINT_OUTPUT="$(golint -set_exit_status $1)" | ||
|
||
if [ $? -ne 0 ]; then | ||
echo "${GOLINT_OUTPUT}" | ||
|
||
exit 1 | ||
fi | ||
|
||
echo "::set-output name=golint-output::Golint step succeed" |