-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from tfsec/add-release
Add release
- Loading branch information
Showing
8 changed files
with
49 additions
and
38 deletions.
There are no files selected for viewing
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,38 @@ | ||
name: tfsec pr commenter release | ||
on: | ||
push: | ||
tags: | ||
- 'v*.*.*' | ||
|
||
jobs: | ||
build: | ||
name: building tfsec commenter | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/setup-go@v2 | ||
with: | ||
stable: 'false' | ||
go-version: '1.16.2' # The Go version to download (if necessary) and use. | ||
- run: go version | ||
|
||
- name: Get Tag | ||
id: get_tag | ||
run: | | ||
echo ::set-output name=TRAVIS_TAG::${GITHUB_REF#refs/tags/} | ||
- name: Build artifacts | ||
run: make build | ||
env: | ||
TRAVIS_TAG: ${{ steps.get_tag.outputs.TRAVIS_TAG }} | ||
|
||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
files: | | ||
bin/commenter | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.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,24 +1,14 @@ | ||
FROM golang:alpine AS builder | ||
|
||
ENV SRCPATH $GOPATH/src/commenter | ||
ENV GO111MODULE auto | ||
COPY ./ $SRCPATH | ||
RUN go install $SRCPATH/cmd/commenter | ||
|
||
FROM alpine:3.12 | ||
|
||
RUN apk --no-cache --update add bash git \ | ||
&& rm -rf /var/cache/apk/* | ||
|
||
SHELL ["/bin/bash", "-eo", "pipefail", "-c"] | ||
|
||
COPY --from=builder /go/bin/commenter / | ||
|
||
RUN chmod +x /commenter | ||
|
||
RUN wget -O - -q "$(wget -q https://api.github.com/repos/tfsec/tfsec/releases/latest -O - | grep -o -E "https://.+?tfsec-linux-amd64")" > tfsec \ | ||
&& install tfsec /usr/local/bin/ | ||
|
||
RUN wget -O - -q "$(wget -q https://github.com/tfsec/tfsec-pr-commenter-action/releases/latest -O - | grep -o -E "https://.+?commenter")" > commenter \ | ||
&& install commenter /usr/local/bin/ | ||
|
||
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.PHONY: build | ||
build: | ||
./scripts/build.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
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env bash | ||
|
||
export GO111MODULE=auto | ||
|
||
GOOS=linux GOARCH=amd64 go build -o bin/commenter ./... |
4 changes: 0 additions & 4 deletions
4
vendor/github.com/owenrumney/go-github-pr-commenter/commenter/commenter.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
2 changes: 0 additions & 2 deletions
2
vendor/github.com/owenrumney/go-github-pr-commenter/commenter/connector.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.