You've already forked go-semantic-release
Compare commits
1 Commits
v2.0.1
...
feat/chang
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fa4ffb54f8 |
23
.githooks/pre-commit
Executable file
23
.githooks/pre-commit
Executable file
@@ -0,0 +1,23 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
## this will retrieve all of the .go files that have been
|
||||||
|
## changed since the last commit
|
||||||
|
STAGED_GO_FILES=$(git diff --cached --name-only -- '*.go')
|
||||||
|
|
||||||
|
if [[ $STAGED_GO_FILES == "" ]]; then
|
||||||
|
echo "No Go Files to Update"
|
||||||
|
## otherwise we can do stuff with these changed go files
|
||||||
|
else
|
||||||
|
for file in $STAGED_GO_FILES; do
|
||||||
|
## format our file
|
||||||
|
go fmt $file
|
||||||
|
## add any potential changes from our formatting to the
|
||||||
|
## commit
|
||||||
|
git add $file
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "go test"
|
||||||
|
go test .././...
|
||||||
|
|
||||||
|
echo "golangci-lint run"
|
||||||
|
golangci-lint run
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
FROM alpine:3.14
|
FROM alpine:3.10.2
|
||||||
|
|
||||||
WORKDIR /code
|
WORKDIR /code
|
||||||
|
|
||||||
COPY ./build/go-semantic-release.linux_x86_64 /usr/local/bin/go-semantic-release
|
COPY ./build/go-semantic-release.linux_x86_64 .
|
||||||
|
|
||||||
USER 1000
|
USER 1000
|
||||||
|
|
||||||
ENTRYPOINT [ "go-semantic-release" ]
|
ENTRYPOINT [ "./go-semantic-release.linux_x86_64" ]
|
||||||
12
README.md
12
README.md
@@ -128,8 +128,6 @@ gitlab:
|
|||||||
tagPrefix: ""
|
tagPrefix: ""
|
||||||
```
|
```
|
||||||
|
|
||||||
You can find an example `.gitlab-ci.yml` in the [examples](examples/.gitlab-ci.yml) folder.
|
|
||||||
|
|
||||||
##### Git only
|
##### Git only
|
||||||
|
|
||||||
Only via https at the moment. You need write access to your git repository
|
Only via https at the moment. You need write access to your git repository
|
||||||
@@ -343,3 +341,13 @@ go test ./...
|
|||||||
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.16.0
|
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.16.0
|
||||||
golangci-lint run ./...
|
golangci-lint run ./...
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Git Hooks
|
||||||
|
|
||||||
|
The `.githooks` folder contains a pre-commit script which has to be run before each commit.
|
||||||
|
To enable the hooks please add the `.githooks` folder to your core hooksPath via: `git config core.hooksPath .githooks`.
|
||||||
|
The following will be run in the pre-commit script:
|
||||||
|
|
||||||
|
- Formats all `*.go` files which are staged with `go fmt`
|
||||||
|
- Runs `go test` for the whole project
|
||||||
|
- Runs `golangci-lint` to check for linting errors
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
stages:
|
|
||||||
- release
|
|
||||||
|
|
||||||
release:
|
|
||||||
stage: release
|
|
||||||
image:
|
|
||||||
name: nightapes/go-semantic-release:latest
|
|
||||||
script:
|
|
||||||
- go-semantic-release next
|
|
||||||
only:
|
|
||||||
- master
|
|
||||||
Reference in New Issue
Block a user