Skip to content

Commit

Permalink
Action first try (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
afarbos authored Apr 24, 2020
1 parent e16d96f commit 7a2d020
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 1 deletion.
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM golang:alpine

RUN apk add git make

RUN go get github.com/gojp/goreportcard && \
go get github.com/gojp/goreportcard/cmd/goreportcard-cli && \
cd $GOPATH/src/github.com/gojp/goreportcard && make install

COPY entrypoint.sh /entrypoint.sh

ENTRYPOINT ["/entrypoint.sh"]
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,19 @@
# go-report-card-action
Github action calling goreportcard-cli and refresh your card

Github action calling goreportcard-cli and refresh your card on https://goreportcard.com

## Inputs

### `threshold`

**Required** Threshold of failure command. Default `75`.

## Example usage

uses: actions/go-report-card-action@v1
with:
threshold: '100'

## Note

inspired by https://github.com/creekorful/goreportcard-action
15 changes: 15 additions & 0 deletions action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: 'Go Report Card'
description: 'Run goreportcard-cli and update project Go report card on https://goreportcard.com'
branding:
icon: 'check-circle'
color: 'green'
inputs:
threshold:
description: 'Threshold of failure command'
required: true
default: '75'
runs:
using: 'docker'
image: 'Dockerfile'
args:
- ${{ inputs.threshold }}
6 changes: 6 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

set -xe

goreportcard-cli -v -t $1
curl -X POST -F "repo=github.com/$GITHUB_REPOSITORY" https://goreportcard.com/checks

0 comments on commit 7a2d020

Please sign in to comment.