Skip to content

Nextflow Lint Comment #683

Nextflow Lint Comment

Nextflow Lint Comment #683

name: Nextflow Lint Comment
on:
workflow_run:
workflows: ["Nextflow Lint"]
types:
- completed
permissions:
contents: read
pull-requests: write
jobs:
comment:
if: github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Download lint results
uses: actions/download-artifact@v4
with:
name: lint-results
github-token: ${{ github.token }}
run-id: ${{ github.event.workflow_run.id }}
- name: Get PR info and report
id: pr-info
run: |
PR_NUMBER=$(cat pr-number.txt)
echo "pr_number=$PR_NUMBER" >> $GITHUB_OUTPUT
echo "comment<<EOF" >> $GITHUB_OUTPUT
cat report.md >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Find existing comment
uses: peter-evans/find-comment@v3
id: find-comment
with:
issue-number: ${{ steps.pr-info.outputs.pr_number }}
comment-author: "github-actions[bot]"
body-includes: "Nextflow linting complete!"
- name: Create or update PR comment
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ steps.find-comment.outputs.comment-id }}
issue-number: ${{ steps.pr-info.outputs.pr_number }}
body: ${{ steps.pr-info.outputs.comment }}
edit-mode: replace