Skip to content

Commit

Permalink
Support Pages uploads from workflows
Browse files Browse the repository at this point in the history
Pages has two build types "legacy" (which seems to be default) and
"workflow". Support also the latter one.

* The intent is to allow the buildType field but not require it
* If buildType=="workflow", branch and path are not used

Signed-off-by: Jussi Kukkonen <[email protected]>
  • Loading branch information
jku committed Feb 7, 2024
1 parent 201b230 commit 5026ec1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
9 changes: 8 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,14 @@ func main() {
WebCommitSignoffRequired: pulumi.Bool(repo.WebCommitSignoffRequired),
}

if repo.Pages.Branch != "" {
if repo.Pages.BuildType == "workflow" {
repoPages := &github.RepositoryPagesArgs{
BuildType: pulumi.String("workflow"),
}
if repo.Pages.CNAME != "" {
repoPages.Cname = pulumi.String(repo.Pages.CNAME)
}
} else if repo.Pages.Branch != "" {
repoPages := &github.RepositoryPagesArgs{}

source := &github.RepositoryPagesSourceArgs{
Expand Down
7 changes: 4 additions & 3 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,10 @@ type Repository struct {
}

type Pages struct {
CNAME string `yaml:"cname"`
Branch string `yaml:"branch"`
Path string `yaml:"path"`
CNAME string `yaml:"cname"`
Branch string `yaml:"branch"`
BuildType string `yaml:"buildType"`
Path string `yaml:"path"`
}

type Template struct {
Expand Down

0 comments on commit 5026ec1

Please sign in to comment.