ソースを参照

fixing bug with branch

Feroze Mohideen 3 年 前
コミット
a249b51b95

+ 2 - 2
dashboard/src/main/home/app-dashboard/new-app-flow/GithubActionModal.tsx

@@ -105,10 +105,10 @@ const GithubActionModal: React.FC<Props> = ({
         }
         isInitiallyExpanded
         spaced
-        copy={getGithubAction(projectId, clusterId, stackName)}
+        copy={getGithubAction(projectId, clusterId, stackName, branch)}
         ExpandedSection={
           <YamlEditor
-            value={getGithubAction(projectId, clusterId, stackName)}
+            value={getGithubAction(projectId, clusterId, stackName, branch)}
             readOnly={true}
             height="300px"
           />

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

@@ -13,11 +13,11 @@ export const overrideObjectValues = (obj1: any, obj2: any) => {
   return obj1;
 };
 
-export const getGithubAction = (projectID?: number, clusterId?: number, stackName?: string) => {
+export const getGithubAction = (projectID?: number, clusterId?: number, stackName?: string, branchName?: string) => {
   return `on:
   push:
     branches:
-    - master
+    - ${branchName}
 name: Deploy to Porter
 jobs:
   porter-deploy:
@@ -34,10 +34,10 @@ jobs:
       with:
         command: apply -f porter.yaml
       env:
-        PORTER_CLUSTER: "${clusterId}"
+        PORTER_CLUSTER: ${clusterId}
         PORTER_HOST: https://dashboard.getporter.dev
-        PORTER_PROJECT: "${projectID}"
-        PORTER_STACK_NAME: "${stackName}"
+        PORTER_PROJECT: ${projectID}
+        PORTER_STACK_NAME: ${stackName}
         PORTER_TAG: \${{ steps.vars.outputs.sha_short }}
         PORTER_TOKEN: \${{ secrets.PORTER_STACK_${projectID}_${clusterId} }}`;
 }