Skip to content

Commit

Permalink
Updates to Action
Browse files Browse the repository at this point in the history
  • Loading branch information
sachasmart committed Sep 23, 2023
1 parent a12e873 commit 58cfd82
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
12 changes: 11 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
FROM curlimages/curl as curl
FROM golang:1.21.1-alpine3.14 AS base

WORKDIR /app

COPY go.mod go.sum ./
COPY ./common ./common
COPY ./types ./types
COPY main.go ./

RUN go mod download


6 changes: 4 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: 'Terrafir Plan Assessment'
description: 'Assess the plan file for security vulnerabilities'
branding:
icon: 'shield'
color: 'blue'
inputs:
api-key:
description: 'API key for Terrafir'
Expand All @@ -9,7 +12,6 @@ inputs:
required: true
plan-file:
description: 'Path to the terraform plan file'

outputs:
time:
description: 'The time plan was assessed' #TODO
Expand All @@ -19,4 +21,4 @@ runs:
args:
- ${{ inputs.api-key }}
- ${{ inputs.email }}
- ${{ inputs.plan-file }}
- ${{ github.workspace }}/${{ inputs.plan-file }}
5 changes: 5 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ func sendRequest(apiKey string, email string, inputFilePath string) {
fmt.Println(err)
return
}
formattedBody(body)

}

func formattedBody(body []byte) {
var formattedBody map[string]interface{}
if err := json.Unmarshal(body, &formattedBody); err != nil {
fmt.Println("Error unmarshaling JSON:", err)
Expand Down

0 comments on commit 58cfd82

Please sign in to comment.