Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions .github/workflows/analyze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,29 @@ jobs:
path: ./results
- name: Copy files to results bucket
run: aws s3 cp ./results s3://cellpack-results/${{ github.ref_name }}/ --recursive --acl public-read
- uses: iterative/setup-cml@v2
with:
vega: false # we only use CML to post markdown reports, so disable vega to skip extra npm installs
- name: Update comment for dependabot
if: ${{ github.actor == 'dependabot[bot]' }}
env:
REPO_TOKEN: ${{ secrets.DEPENDABOT_TOKEN }}
GH_TOKEN: ${{ secrets.DEPENDABOT_TOKEN }}
run: |
cml comment update --watermark-title="{workflow} report" ./results/analysis_report.md --target=pr
MARKER="<!-- Analyze workflow report -->"
COMMENT_BODY="${MARKER}\n$(cat ./results/analysis_report.md)"
EXISTING_COMMENT_ID=$(gh pr view ${{ github.event.pull_request.number }} --json comments --jq ".comments[] | select(.body | contains(\"${MARKER}\")) | .id" | head -1)
if [ ! -z "$EXISTING_COMMENT_ID" ]; then
gh api -X DELETE /repos/${{ github.repository }}/issues/comments/$EXISTING_COMMENT_ID
fi
echo -e "$COMMENT_BODY" | gh pr comment ${{ github.event.pull_request.number }} --body-file -
cat ./results/analysis_report.md
- name: Update comment for PR
if: ${{ github.actor != 'dependabot[bot]' }}
env:
REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cml comment update --watermark-title="{workflow} report" ./results/analysis_report.md --target=pr
MARKER="<!-- Analyze workflow report -->"
COMMENT_BODY="${MARKER}\n$(cat ./results/analysis_report.md)"
EXISTING_COMMENT_ID=$(gh pr view ${{ github.event.pull_request.number }} --json comments --jq ".comments[] | select(.body | contains(\"${MARKER}\")) | .id" | head -1)
if [ ! -z "$EXISTING_COMMENT_ID" ]; then
gh api -X DELETE /repos/${{ github.repository }}/issues/comments/$EXISTING_COMMENT_ID
fi
echo -e "$COMMENT_BODY" | gh pr comment ${{ github.event.pull_request.number }} --body-file -
cat ./results/analysis_report.md
Loading