From c73bf12edf995f1a8c4dea496654fcf146d01ebc Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Wed, 20 Nov 2024 10:28:13 +0100 Subject: [PATCH] Add additional status that we can use for branch protection --- .github/workflows/pr_without_change.yml | 18 ++++++++++++++++++ .github/workflows/workflow_test.yml | 11 +++++++++++ 2 files changed, 29 insertions(+) create mode 100644 .github/workflows/pr_without_change.yml diff --git a/.github/workflows/pr_without_change.yml b/.github/workflows/pr_without_change.yml new file mode 100644 index 000000000..c28eced8d --- /dev/null +++ b/.github/workflows/pr_without_change.yml @@ -0,0 +1,18 @@ +name: Fallback +# Fallback workflow that provides a succeeding "Check workflow success" job +# as this is a requirement for being able to merge a PR +# see https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks +on: + pull_request: + paths: + - 'scripts/**' + - 'website/**' +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true +jobs: + determine-success: + name: Check workflow success + runs-on: ubuntu-latest + steps: + - run: 'echo "No workflow tests required for this PR"' diff --git a/.github/workflows/workflow_test.yml b/.github/workflows/workflow_test.yml index 28d0d0b3a..15be87ff1 100644 --- a/.github/workflows/workflow_test.yml +++ b/.github/workflows/workflow_test.yml @@ -40,6 +40,7 @@ jobs: run: pip install wheel - name: Planemo lint workflows uses: galaxyproject/planemo-ci-action@v1 + id: lint with: mode: lint workflows: true @@ -169,3 +170,13 @@ jobs: Attention: deployment ${{ needs.deploy.result }}! https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} + + determine-success: + name: Check workflow success + needs: [setup, lint, combine_outputs] + if: ${{ always() && github.ref != 'refs/heads/main' }} + runs-on: ubuntu-latest + steps: + - name: Check status + if: ${{ needs.combine_outputs.result != 'skipped' && (needs.lint.result != 'success' || needs.combine_outputs.result != 'success') }} + run: exit 1