Test linting latest version #12
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: nf-core template version comment | |
# This workflow is triggered on PRs to check if the pipeline template version matches the latest. | |
# It posts a comment on the PR, even if it comes from a fork. | |
on: | |
pull_request_target: | |
jobs: | |
check_version: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out pipeline code | |
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Read template version from .nf-core.yml | |
uses: nichmor/minimal-read-yaml@v0.0.2 | |
id: read_yml | |
with: | |
config: ${{ github.workspace }}/.nf-core.yml | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install nf-core==${{ steps.read_yml.outputs['nf_core_version'] }} | |
- name: Check nf-core outdated | |
id: nf_core_outdated | |
run: echo "OUTPUT=$(pip list --outdated | grep nf-core)" >> ${GITHUB_ENV} | |
- name: Debug OUTPUT | |
run: echo "OUTPUT is '${{ env.OUTPUT }}'" | |
- name: Post nf-core last version comment | |
uses: mshick/add-pr-comment@b8f338c590a895d50bcbfa6c5859251edc8952fc # v2 | |
if: | | |
${{ env.OUTPUT }} =~ 'nf-core' | |
with: | |
repo-token: ${{ secrets.NF_CORE_BOT_AUTH_TOKEN }} | |
allow-repeats: false | |
message: | | |
> [!WARNING] | |
> Newer version of the nf-core template is available. | |
> | |
> Your pipeline is using an old version of the nf-core template: ${{ steps.read_yml.outputs['nf_core_version'] }}. | |
> Please update your pipeline to the latest version. | |
> | |
> For more documentation on how to update your pipeline, please see the [nf-core documentation](https://github.com/nf-core/tools?tab=readme-ov-file#sync-a-pipeline-with-the-template) and [Synchronisation documentation](https://nf-co.re/docs/contributing/sync). |