From 0e0eefba2be62c0d8942ef0d38f92407dcbb325b Mon Sep 17 00:00:00 2001 From: Aetherinox Date: Mon, 17 Mar 2025 16:22:03 -0700 Subject: [PATCH] ci: fix workflow pr issue --- .github/workflows/issues-scan.yml | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/.github/workflows/issues-scan.yml b/.github/workflows/issues-scan.yml index 3de72725..cc790bc2 100755 --- a/.github/workflows/issues-scan.yml +++ b/.github/workflows/issues-scan.yml @@ -196,15 +196,20 @@ jobs: } else { - // Otherwise return issue number from commit - return ( + const data = ( await github.rest.repos.listPullRequestsAssociatedWithCommit( { - commit_sha: context.sha, - owner: context.repo.owner, - repo: context.repo.repo, + commit_sha: context.sha, + owner: context.repo.owner, + repo: context.repo.repo, }) - ).data[ 0 ].number; + ).data[0]; + + if (data) { + return data.number; + } else { + return '32'; + } } result-encoding: string @@ -299,11 +304,8 @@ jobs: with: github-token: ${{ secrets.ADMINSERV_TOKEN_CL }} script: | - console.log(`-----------------------------------------------------------------------------------------------`) - console.log(` PR Created ............ ${ context.payload.pull_request.created_at }`) - console.log(` PR head_ref ........... ${ context.payload.pull_request.head.ref }`) + console.log('Running Autoscan') console.log(` PR Context ............ ${ context }`) - console.log(`-----------------------------------------------------------------------------------------------`) const fs = require( 'fs' ); const escape_html = ( unsafe ) => unsafe.replace( /&/g, '&' ).replace( //g, '>' ).replace( /"/g, '"' ).replace( /'/g, ''' ); @@ -397,7 +399,7 @@ jobs: const type_dependency = [ "dependabot/npm_and_yarn", - "renovate/user-agents-1.x" + "renovate/github_actions" ]; const type_gitaction =