Skip to content

Commit

Permalink
fix(updateComment): fix update comment failed when action was run man…
Browse files Browse the repository at this point in the history
…ually
  • Loading branch information
edison1105 committed Nov 14, 2024
1 parent e7e3d07 commit a9c3cb6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/ecosystem-ci-from-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,11 @@ jobs:
needs: [init, execute-selected-suite, execute-all]
if: always()
steps:
- id: update-comment
- uses: actions/github-script@v7
with:
github-token: ${{ secrets.ECOSYSTEM_CI_ACCESS_TOKEN }}
result-encoding: string
script: |
const { data: { jobs } } = await github.rest.actions.listJobsForWorkflowRun({
owner: context.repo.owner,
Expand Down Expand Up @@ -234,12 +236,14 @@ jobs:
await github.rest.issues.deleteComment({
owner: context.repo.owner,
repo: 'core',
comment_id: ${{ needs.init.outputs.comment-id }}
comment_id: ${{ steps.update-comment.outputs.result || needs.init.outputs.comment-id }}
})
await github.rest.issues.createComment({
const { data: comment } = await github.rest.issues.createComment({
issue_number: context.payload.inputs.prNumber,
owner: context.repo.owner,
repo: 'core',
body
})
return comment.id

0 comments on commit a9c3cb6

Please sign in to comment.