-
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.
Merge pull request #1 from farmersdog/setup
Set up Dockerfile
- Loading branch information
Showing
7 changed files
with
119 additions
and
1 deletion.
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,15 @@ | ||
Binaries for programs and plugins | ||
*.exe | ||
*.exe~ | ||
*.dll | ||
*.so | ||
*.dylib | ||
|
||
# Test binary, built with `go test -c` | ||
*.test | ||
|
||
# Output of the go coverage tool, specifically when used with LiteIDE | ||
*.out | ||
|
||
# Dependency directories (remove the comment below to include it) | ||
# vendor/ |
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,47 @@ | ||
# Credit: https://www.sethvargo.com/writing-github-actions-in-go/ | ||
# | ||
# Step 1 | ||
# | ||
|
||
FROM golang:1.15 AS builder | ||
|
||
# Install upx (upx.github.io) to compress the compiled action | ||
RUN apt-get update && apt-get -y install upx | ||
|
||
# Turn on Go modules support and disable CGO | ||
ENV GO111MODULE=on CGO_ENABLED=0 | ||
|
||
COPY . . | ||
|
||
RUN go build \ | ||
-a \ | ||
-trimpath \ | ||
-ldflags "-s -w -extldflags '-static'" \ | ||
-installsuffix cgo \ | ||
-tags netgo \ | ||
-o /bin/action \ | ||
. | ||
|
||
# Strip any symbols - this is not a library | ||
RUN strip /bin/action | ||
|
||
# Compress the compiled action | ||
RUN upx -q -9 /bin/action | ||
|
||
|
||
# Step 2 | ||
|
||
# Use the most basic and empty container - this container has no | ||
# runtime, files, shell, libraries, etc. | ||
FROM scratch | ||
|
||
# Copy over SSL certificates from the first step - this is required | ||
# if our code makes any outbound SSL connections because it contains | ||
# the root CA bundle. | ||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ | ||
|
||
# Copy over the compiled action from the first step | ||
COPY --from=builder /bin/action /bin/action | ||
|
||
# Specify the container's entrypoint as the action | ||
ENTRYPOINT ["/bin/action"] |
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 +1,21 @@ | ||
# clubhouse-pr | ||
# ClubHouse Pull Request Github Action | ||
|
||
Insert description here, Rae. | ||
|
||
## Inputs | ||
|
||
### `ch-id` | ||
|
||
**Required** The Clubhouse story ID (ie. '[ch0]') | ||
|
||
## Outputs | ||
|
||
### `pr-title` | ||
|
||
The title of the pull request | ||
|
||
## Example usage | ||
|
||
uses: actions/clubhouse-pr@v1 | ||
with: | ||
pr-title: '[ch0]' |
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,15 @@ | ||
name: 'Clubhouse Pull Request' | ||
description: 'Populate PR fields with Clubhouse story information' | ||
inputs: | ||
ch-id: | ||
description: 'Clubhouse ID (ie. [ch0])' | ||
required: true | ||
default: '[ch0]' | ||
outputs: | ||
pr-title: | ||
description: 'Pull Request Title from Clubhouse' | ||
runs: | ||
using: 'docker' | ||
image: 'Dockerfile' | ||
args: | ||
- ${{ inputs.ch-id }} |
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 @@ | ||
module github.com/farmersdog/clubhouse-pr | ||
|
||
go 1.15 | ||
|
||
require github.com/sethvargo/go-githubactions v0.2.0 // indirect |
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,2 @@ | ||
github.com/sethvargo/go-githubactions v0.2.0 h1:CKdUfKUJvqqYz7/7l36K2DmsP5JZPycnvjfT5Ae7BVE= | ||
github.com/sethvargo/go-githubactions v0.2.0/go.mod h1:ugCoIFQjs7HxIwwYiY7ty6H9T+7Z4ey481HxqA3VRKE= |
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 @@ | ||
package main | ||
|
||
import "github.com/sethvargo/go-githubactions" | ||
|
||
func main() { | ||
chId := githubactions.GetInput("ch-id") | ||
|
||
if chId == "" { | ||
githubactions.Fatalf("missing input 'ch-id'") | ||
} | ||
|
||
// TODO: will want to use this for some inputs: | ||
// githubactions.AddMask(fruit) | ||
} |