Skip to content

Commit

Permalink
more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sterlingwes committed Feb 6, 2024
1 parent 5d8491d commit 7e629ff
Showing 1 changed file with 26 additions and 4 deletions.
30 changes: 26 additions & 4 deletions .github/workflows/gen-killed-in-gaza.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ jobs:
run: |
# if our log output has lines there's issues worth noting
if [[ $(wc -l <ci-tmp/killed-in-gaza-log.txt) -ge 2 ]]; then
echo "logs=1" >> "" >> "$GITHUB_OUTPUT"
echo "logs=1" >> "$GITHUB_OUTPUT"
fi
if [[ $(wc -l <ci-tmp/killed-in-gaza-json.diff) -ge 1 ]]; then
echo "diff=1" >> "" >> "$GITHUB_OUTPUT"
echo "diff=1" >> "$GITHUB_OUTPUT"
fi
- uses: actions/github-script@v7
Expand Down Expand Up @@ -104,9 +104,31 @@ jobs:
body += '- [ ] a diff of the JSON file changes for review\n'
}
github.rest.issues.createComment({
const commonInputs = {
issue_number: process.env.PRNUM,
owner: context.repo.owner,
repo: context.repo.repo,
repo: context.repo.repo
}
// delete prior comments
const comments = await github.rest.issues.listComments(commonInputs)
const idsToDelete = comments
.filter(comment => comment.user.login.includes('github-action'))
.map(comment => comment.id)
console.log(`found ${idsToDelete.length} comments to delete: ${idsToDelete.join(',')}`)
if (idsToDelete.length) {
await idsToDelete.reduce(async (chain, comment_id) => {
await chain;
await github.rest.issues.deleteComment({
...commonInputs,
comment_id
})
}, Promise.resolve())
}
await github.rest.issues.createComment({
...commonInputs,
body
})

0 comments on commit 7e629ff

Please sign in to comment.