ci: fix workflow pr issue

This commit is contained in:
2025-03-17 16:22:03 -07:00
parent 06cbd4663c
commit 0e0eefba2b

View File

@@ -196,15 +196,20 @@ jobs:
} }
else else
{ {
// Otherwise return issue number from commit const data = (
return (
await github.rest.repos.listPullRequestsAssociatedWithCommit( await github.rest.repos.listPullRequestsAssociatedWithCommit(
{ {
commit_sha: context.sha, commit_sha: context.sha,
owner: context.repo.owner, owner: context.repo.owner,
repo: context.repo.repo, repo: context.repo.repo,
}) })
).data[ 0 ].number; ).data[0];
if (data) {
return data.number;
} else {
return '32';
}
} }
result-encoding: string result-encoding: string
@@ -299,11 +304,8 @@ jobs:
with: with:
github-token: ${{ secrets.ADMINSERV_TOKEN_CL }} github-token: ${{ secrets.ADMINSERV_TOKEN_CL }}
script: | script: |
console.log(`-----------------------------------------------------------------------------------------------`) console.log('Running Autoscan')
console.log(` PR Created ............ ${ context.payload.pull_request.created_at }`)
console.log(` PR head_ref ........... ${ context.payload.pull_request.head.ref }`)
console.log(` PR Context ............ ${ context }`) console.log(` PR Context ............ ${ context }`)
console.log(`-----------------------------------------------------------------------------------------------`)
const fs = require( 'fs' ); const fs = require( 'fs' );
const escape_html = ( unsafe ) => unsafe.replace( /&/g, '&amp;' ).replace( /</g, '&lt;' ).replace( />/g, '&gt;' ).replace( /"/g, '&quot;' ).replace( /'/g, '&#039;' ); const escape_html = ( unsafe ) => unsafe.replace( /&/g, '&amp;' ).replace( /</g, '&lt;' ).replace( />/g, '&gt;' ).replace( /"/g, '&quot;' ).replace( /'/g, '&#039;' );
@@ -397,7 +399,7 @@ jobs:
const type_dependency = const type_dependency =
[ [
"dependabot/npm_and_yarn", "dependabot/npm_and_yarn",
"renovate/user-agents-1.x" "renovate/github_actions"
]; ];
const type_gitaction = const type_gitaction =