Skip to content

Commit

Permalink
convert bools to strings for isempty arg
Browse files Browse the repository at this point in the history
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
  • Loading branch information
vsoch committed Sep 16, 2021
1 parent b607d3c commit 47a5e15
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion parsers/docker/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"log"
"path/filepath"
"reflect"
"strconv"
"strings"

"github.com/vsoch/uptodate/config"
Expand Down Expand Up @@ -212,7 +213,7 @@ func (s *DockerBuildParser) Parse(path string, changesOnly bool, branch string)

// If we are running in a GitHub Action, set the outputs
if utils.IsGitHubAction() {
fmt.Printf("::set-output name=dockerbuild_matrix_empty::%s\n", isEmpty)
fmt.Printf("::set-output name=dockerbuild_matrix_empty::%s\n", strconv.FormatBool(isEmpty))
fmt.Printf("::set-output name=dockerbuild_matrix::%s\n", output)
}
}
Expand Down
3 changes: 2 additions & 1 deletion parsers/docker/dockerfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"fmt"
"log"
"reflect"
"strconv"
"strings"

df "github.com/asottile/dockerfile"
Expand Down Expand Up @@ -351,7 +352,7 @@ func (s *DockerfileParser) Parse(path string, dryrun bool, changesOnly bool, bra
isEmpty = true
}
fmt.Printf("::set-output name=dockerfile_matrix::%s\n", output)
fmt.Printf("::set-output name=dockerfile_matrix_empty::%s\n", isEmpty)
fmt.Printf("::set-output name=dockerfile_matrix_empty::%s\n", strconv.FormatBool(isEmpty))
}
return nil
}
3 changes: 2 additions & 1 deletion parsers/docker/dockerfilelist.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package docker
import (
"encoding/json"
"fmt"
"strconv"

"github.com/vsoch/uptodate/parsers"
"github.com/vsoch/uptodate/parsers/git"
Expand Down Expand Up @@ -77,7 +78,7 @@ func (s *DockerfileListParser) Parse(path string, includeEmptyArgs bool, include
isEmpty = true
}
fmt.Printf("::set-output name=dockerfilelist_matrix::%s\n", output)
fmt.Printf("::set-output name=dockerfilelist_matrix_empty::%s\n", isEmpty)
fmt.Printf("::set-output name=dockerfilelist_matrix_empty::%s\n", strconv.FormatBool(isEmpty))
}
return nil
}
3 changes: 2 additions & 1 deletion parsers/docker/hierarchy.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"log"
"os"
fpath "path"
"strconv"

df "github.com/asottile/dockerfile"
"github.com/vsoch/uptodate/config"
Expand Down Expand Up @@ -241,7 +242,7 @@ func (s *DockerHierarchyParser) Update(dryrun bool) error {
isEmpty = true
}
fmt.Printf("::set-output name=dockerhierarchy_matrix::%s\n", output)
fmt.Printf("::set-output name=dockerhierarchy_matrix_empty::%s\n", isEmpty)
fmt.Printf("::set-output name=dockerhierarchy_matrix_empty::%s\n", strconv.FormatBool(isEmpty))
}

return nil
Expand Down
3 changes: 2 additions & 1 deletion parsers/git/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"log"
"path/filepath"
"strconv"
"strings"

gogit "github.com/go-git/go-git/v5"
Expand Down Expand Up @@ -182,7 +183,7 @@ func (s *GitParser) Parse(path string, branch string) error {
// If we are running in a GitHub Action, set the outputs
if utils.IsGitHubAction() {
fmt.Printf("::set-output name=git_matrix::%s\n", string(outJson))
fmt.Printf("::set-output name=git_matrix_empty::%s\n", isEmpty)
fmt.Printf("::set-output name=git_matrix_empty::%s\n", strconv.FormatBool(isEmpty))
}
return nil
}

0 comments on commit 47a5e15

Please sign in to comment.