Przeglądaj źródła

fix workflow paths issue

Ian Edwards 2 lat temu
rodzic
commit
109dab0f4d

+ 5 - 1
dashboard/src/main/home/app-dashboard/new-app-flow/utils.ts

@@ -57,12 +57,16 @@ export const getPreviewGithubAction = (
   projectID: number,
   clusterId: number,
   stackName: string,
+  branchName: string,
   porterYamlPath: string = "porter.yaml"
 ) => {
   return `on:
   pull_request:
+    paths:
+    - *
+    - '!./github/workflows/porter-**'
     branches:
-    - '!porter-**'
+    - ${branchName}
     types:
     - opened
     - synchronize

+ 1 - 0
internal/integrations/ci/actions/actions.go

@@ -233,6 +233,7 @@ type GithubActionYAMLOnPullRequest struct {
 type GithubActionYAMLOnPullRequestTypes struct {
 	Branches []string `yaml:"branches,omitempty"`
 	Types    []string `yaml:"types,omitempty"`
+	Paths    []string `yaml:"paths,omitempty"`
 }
 
 type GithubActionYAMLJob struct {

+ 5 - 1
internal/integrations/ci/actions/stack.go

@@ -193,8 +193,12 @@ func getStackApplyActionYAML(opts *GetStackApplyActionYAMLOpts) ([]byte, error)
 		actionYaml := GithubActionYAML{
 			On: GithubActionYAMLOnPullRequest{
 				PullRequest: GithubActionYAMLOnPullRequestTypes{
+					Paths: []string{
+						"*",
+						"!./github/workflows/porter-**",
+					},
 					Branches: []string{
-						"!porter-**",
+						opts.DefaultBranch,
 					},
 					Types: []string{
 						"opened",