This commit is contained in:
SnskArora 2025-06-02 20:38:50 +05:30
parent ddafc41052
commit 3c5f87687d
No known key found for this signature in database
GPG key ID: 6EC7FEA48093AB59
3 changed files with 6 additions and 4 deletions

View file

@ -5,7 +5,7 @@ RUN go mod tidy
RUN CGO_ENABLED=0 go build -o app .
FROM alpine:3.14
LABEL org.opencontainers.image.source=https://github.com/trstringer/manual-approval
LABEL org.opencontainers.image.source=https://github.com/snskarora/manual-approval
RUN apk update && apk add ca-certificates
COPY --from=builder /var/app/app /var/app/app
CMD ["/var/app/app"]

View file

@ -127,11 +127,13 @@ func (a *approvalEnvironment) SetActionOutputs(outputs map[string]string) (bool,
}
f, err := os.OpenFile(outputFile, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
if err != nil {
return false, err
}
defer f.Close()
defer func() {
_ = f.Close() // Error explicitly ignored as there is nothing to handle if file close fails.
}()
var pairs []string

View file

@ -467,7 +467,7 @@ func TestSaveOutput(t *testing.T) {
for _, testCase := range testCases {
t.Run(testCase.name, func(t *testing.T) {
os.Setenv("GITHUB_OUTPUT", testCase.env_github_output)
t.Setenv("GITHUB_OUTPUT", testCase.env_github_output)
a := approvalEnvironment{
client: nil,
repoFullName: "",