Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
run: nf-core -l lint_log.txt pipelines lint --release --dir ${GITHUB_WORKSPACE} --markdown lint_results.md

- name: Save PR number
if: ${{ always() }}
if: ${{ always() && github.event.pull_request.number }}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Line 69 causes template drift and keeps files_unchanged lint failing

This condition is not needed anymore now that linting_comment.yml safely skips invalid/missing PR numbers, and it appears to be the reason the nf-core template check is failing in this PR.

Suggested template-compatible fix
-      - name: Save PR number
-        if: ${{ always() && github.event.pull_request.number }}
+      - name: Save PR number
+        if: ${{ always() }}
         run: echo ${{ github.event.pull_request.number }} > PR_number.txt

Based on learnings: Run nf-core pipelines lint before merging code to ensure pipeline standards compliance (use --release flag for master branch PRs).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/linting.yml at line 69, The linting job contains an
unnecessary PR-number guard (the line with the if-condition checking
github.event.pull_request.number) which causes template drift and breaks the
nf-core template check; remove that conditional so the step runs under the
workflow's existing guards (or replace it with a simple always() check) to allow
linting_comment.yml to handle missing/invalid PR numbers and restore template
compatibility.

run: echo ${{ github.event.pull_request.number }} > PR_number.txt

- name: Upload linting log file artifact
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/linting_comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,20 @@ jobs:
id: pr_number
run: |
if [ ! -f linting-logs/PR_number.txt ]; then
echo "PR number file not found"
exit 1
echo "No PR number file found (not a PR event), skipping comment"
echo "skip=true" >> $GITHUB_OUTPUT
exit 0
fi
PR_NUM=$(cat linting-logs/PR_number.txt)
if ! [[ "$PR_NUM" =~ ^[0-9]+$ ]]; then
echo "Invalid PR number: $PR_NUM"
exit 1
echo "Invalid PR number: $PR_NUM, skipping comment"
echo "skip=true" >> $GITHUB_OUTPUT
exit 0
fi
echo "pr_number=$PR_NUM" >> $GITHUB_OUTPUT

- name: Post PR comment
if: ${{ steps.pr_number.outputs.skip != 'true' }}
uses: marocchino/sticky-pull-request-comment@773744901bac0e8cbb5a0dc842800d45e9b2b405 # v2
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
1 change: 1 addition & 0 deletions .nf-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ lint:
- .github/PULL_REQUEST_TEMPLATE.md
- .github/CONTRIBUTING.md
- .github/workflows/branch.yml
- .github/workflows/linting.yml
- .github/workflows/linting_comment.yml
- .github/.dockstore.yml
- docs/README.md
Expand Down
Loading