From 7f4eb68598e2faad2d4dd1249681a5998dcec557 Mon Sep 17 00:00:00 2001 From: Edmund Miller Date: Wed, 20 Nov 2024 13:07:43 -0600 Subject: [PATCH] ci(lint): Get the module name https://github.com/nf-core/tools/pull/3141 --- .github/workflows/lint.yml | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 2ef75c27e04..8298448674c 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -86,7 +86,7 @@ jobs: strategy: fail-fast: false matrix: - tags: "${{ fromJson(needs.nf-core-changes.outputs.modules_files) }}" + files: "${{ fromJson(needs.nf-core-changes.outputs.modules_files) }}" steps: - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 @@ -117,8 +117,16 @@ jobs: - name: Install nf-core tools development version run: python -m pip install --upgrade --force-reinstall git+https://github.com/nf-core/tools.git@dev - - name: Lint module ${{ matrix.tags }} - run: nf-core modules lint ${{ matrix.tags }} + - name: Get module name + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7 + id: name + with: + result-encoding: string + script: | + return '${{ matrix.files }}'.replace('modules/nf-core/', '').replace('/main.nf', ''); + + - name: Lint module ${{steps.name.outputs.result}} + run: nf-core modules lint ${{steps.name.outputs.result}} nf-core-lint-subworkflows: runs-on: ubuntu-latest @@ -128,7 +136,7 @@ jobs: strategy: fail-fast: false matrix: - tags: "${{ fromJson(needs.nf-core-changes.outputs.subworkflows_files) }}" + files: "${{ fromJson(needs.nf-core-changes.outputs.subworkflows_files) }}" steps: - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 @@ -151,8 +159,16 @@ jobs: - name: Install nf-core tools development version run: python -m pip install --upgrade --force-reinstall git+https://github.com/nf-core/tools.git@dev - - name: Lint module ${{ matrix.tags }} - run: nf-core subworkflows lint ${{ matrix.tags }} + - name: Get module name + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7 + id: name + with: + result-encoding: string + script: | + return '${{ matrix.files }}'.replace('modules/nf-core/', '').replace('/main.nf', ''); + + - name: Lint subworkflow ${{steps.name.outputs.result}} + run: nf-core subworkflows lint ${{steps.name.outputs.result}} confirm-pass: runs-on: ubuntu-latest