This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch master
in repository 
https://gitbox.apache.org/repos/asf/airflow-cancel-workflow-runs.git

commit 169f1694e07cdfff421539599c048cdc276e2a00
Author: Jarek Potiuk <[email protected]>
AuthorDate: Sun Nov 1 18:29:19 2020 +0100

    Revert problem with non-iterable data.jobs sometimes.
    
    The data.jobs is apparently deprecated but getting rid of it
    causes data not iterable sometimes. Before investigation we want to
    revert that to stop failures from happening
---
 dist/index.js | 2 +-
 src/main.ts   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dist/index.js b/dist/index.js
index 09fdb5d..a46b432 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -1627,7 +1627,7 @@ function jobsMatchingNames(repositoryInfo, runId, 
jobNameRegexps, checkIfFailed)
         try {
             for (var _b = 
__asyncValues(repositoryInfo.octokit.paginate.iterator(listJobs)), _c; _c = 
yield _b.next(), !_c.done;) {
                 const item = _c.value;
-                for (const job of item.data) {
+                for (const job of item.data.jobs) {
                     core.info(`    The job name: ${job.name}, Conclusion: 
${job.conclusion}`);
                     const [jobMatched, jobMatches] = matchInArray(job.name, 
jobNameRegexps);
                     if (jobMatched) {
diff --git a/src/main.ts b/src/main.ts
index 3c4eab1..7ee681b 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -228,7 +228,7 @@ async function jobsMatchingNames(
   const allMatches: string[] = []
   let matched = false
   for await (const item of repositoryInfo.octokit.paginate.iterator(listJobs)) 
{
-    for (const job of item.data) {
+    for (const job of item.data.jobs) {
       core.info(`    The job name: ${job.name}, Conclusion: ${job.conclusion}`)
       const [jobMatched, jobMatches] = matchInArray(job.name, jobNameRegexps)
       if (jobMatched) {

Reply via email to