Browse Source

fix: update github-script actions

Signed-off-by: Moritz Johner <beller.moritz@googlemail.com>
Moritz Johner 4 years ago
parent
commit
6a06d3c4f6
2 changed files with 9 additions and 9 deletions
  1. 6 6
      .github/workflows/e2e-managed.yml
  2. 3 3
      .github/workflows/e2e.yml

+ 6 - 6
.github/workflows/e2e-managed.yml

@@ -64,7 +64,7 @@ jobs:
           });
           });
           const ref = pull.head.sha;
           const ref = pull.head.sha;
           console.log("\n\nPR sha: " + ref)
           console.log("\n\nPR sha: " + ref)
-          const { data: checks } = await github.checks.listForRef({
+          const { data: checks } = await github.rest.checks.listForRef({
             ...context.repo,
             ...context.repo,
             ref
             ref
           });
           });
@@ -74,14 +74,14 @@ jobs:
           console.log("\n\nPR Filtered CHECK: " + check)
           console.log("\n\nPR Filtered CHECK: " + check)
           console.log(check)
           console.log(check)
           if(check && check.length > 0){
           if(check && check.length > 0){
-            const { data: result } = await github.checks.update({
+            const { data: result } = await github.rest.checks.update({
               ...context.repo,
               ...context.repo,
               check_run_id: check[0].id,
               check_run_id: check[0].id,
               status: 'in_progress',
               status: 'in_progress',
             });
             });
             return result;
             return result;
           }
           }
-          const { data: result } = await github.checks.create({
+          const { data: result } = await github.rest.checks.create({
             ...context.repo,
             ...context.repo,
             name: job_name,
             name: job_name,
             head_sha: pull.head.sha,
             head_sha: pull.head.sha,
@@ -212,13 +212,13 @@ jobs:
       with:
       with:
         github-token: ${{ secrets.GITHUB_TOKEN }}
         github-token: ${{ secrets.GITHUB_TOKEN }}
         script: |
         script: |
-          const { data: pull } = await github.pulls.get({
+          const { data: pull } = await github.rest.pulls.get({
             ...context.repo,
             ...context.repo,
             pull_number: process.env.number
             pull_number: process.env.number
           });
           });
           const ref = pull.head.sha;
           const ref = pull.head.sha;
           console.log("\n\nPR sha: " + ref)
           console.log("\n\nPR sha: " + ref)
-          const { data: checks } = await github.checks.listForRef({
+          const { data: checks } = await github.rest.checks.listForRef({
             ...context.repo,
             ...context.repo,
             ref
             ref
           });
           });
@@ -227,7 +227,7 @@ jobs:
           const check = checks.check_runs.filter(c => c.name === job_name);
           const check = checks.check_runs.filter(c => c.name === job_name);
           console.log("\n\nPR Filtered CHECK: " + check)
           console.log("\n\nPR Filtered CHECK: " + check)
           console.log(check)
           console.log(check)
-          const { data: result } = await github.checks.update({
+          const { data: result } = await github.rest.checks.update({
             ...context.repo,
             ...context.repo,
             check_run_id: check[0].id,
             check_run_id: check[0].id,
             status: 'completed',
             status: 'completed',

+ 3 - 3
.github/workflows/e2e.yml

@@ -167,13 +167,13 @@ jobs:
       with:
       with:
         github-token: ${{ secrets.GITHUB_TOKEN }}
         github-token: ${{ secrets.GITHUB_TOKEN }}
         script: |
         script: |
-          const { data: pull } = await github.pulls.get({
+          const { data: pull } = await github.rest.pulls.get({
             ...context.repo,
             ...context.repo,
             pull_number: process.env.number
             pull_number: process.env.number
           });
           });
           const ref = pull.head.sha;
           const ref = pull.head.sha;
           console.log("\n\nPR sha: " + ref)
           console.log("\n\nPR sha: " + ref)
-          const { data: checks } = await github.checks.listForRef({
+          const { data: checks } = await github.rest.checks.listForRef({
             ...context.repo,
             ...context.repo,
             ref
             ref
           });
           });
@@ -181,7 +181,7 @@ jobs:
           const check = checks.check_runs.filter(c => c.name === process.env.job);
           const check = checks.check_runs.filter(c => c.name === process.env.job);
           console.log("\n\nPR Filtered CHECK: " + check)
           console.log("\n\nPR Filtered CHECK: " + check)
           console.log(check)
           console.log(check)
-          const { data: result } = await github.checks.update({
+          const { data: result } = await github.rest.checks.update({
             ...context.repo,
             ...context.repo,
             check_run_id: check[0].id,
             check_run_id: check[0].id,
             status: 'completed',
             status: 'completed',