From df5c63d158418563689cd2574f242fd3c1063b49 Mon Sep 17 00:00:00 2001 From: Hubert Bugaj Date: Wed, 8 Jan 2025 13:16:27 +0100 Subject: [PATCH] fix: docs don't trigger required checks --- .github/workflows/docs-required-override.yml | 72 ++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 .github/workflows/docs-required-override.yml diff --git a/.github/workflows/docs-required-override.yml b/.github/workflows/docs-required-override.yml new file mode 100644 index 00000000000..fd48ab5c463 --- /dev/null +++ b/.github/workflows/docs-required-override.yml @@ -0,0 +1,72 @@ +# This workflow is triggered by changes on the documentation. Normally, if only documentation is modified, the required Forest checks are not triggered which makes it impossible to merge the PR. See . The workaround is to provide no-op jobs that are triggered by the same events as the docs-check job. This way, the "required checks" are passing and the PR can be merged. + +name: Docs Required Override +concurrency: + group: '${{ github.workflow }}-${{ github.ref }}' + cancel-in-progress: '${{ github.ref != ''refs/heads/main'' }}' + +on: + workflow_dispatch: + merge_group: + pull_request: + branches: + - main + paths: + - '**.md' + - 'docs/**' + - '.github/workflows/docs-check.yml' + - '.github/workflows/docs-required-override.yml' + push: + branches: + - main + paths: + - '**.md' + - 'docs/**' + - '.github/workflows/docs-check.yml' + - '.github/workflows/docs-required-override.yml' + +jobs: + # We need this because merge groups dont support path filters + # https://github.com/community/community/discussions/45899 + changes-docs: + runs-on: ubuntu-latest + outputs: + changesFound: ${{ steps.filter.outputs.changesFound }} + steps: + - uses: actions/checkout@v4 + - uses: dorny/paths-filter@v3 + id: filter + with: + filters: | + changesFound: + - 'docs/**' + - '**.md' + - '.github/workflows/docs-check.yml' + - '.github/workflows/docs-required-override.yml' + changes-not-docs: + runs-on: ubuntu-latest + outputs: + otherChangesFound: ${{ steps.filter.outputs.otherChangesFound }} + steps: + - uses: actions/checkout@v4 + - uses: dorny/paths-filter@v3 + id: filter + with: + predicate-quantifier: every + filters: | + otherChangesFound: + - '**' + - '!docs/**' + - '!**.md' + - '!.github/workflows/docs-check.yml' + - '!.github/workflows/docs-required-override.yml' + + test2: + name: Calibnet check + runs-on: ubuntu-latest + needs: + - changes-docs + - changes-not-docs + if: ${{ (needs.changes-docs.outputs.changesFound == 'true') && (needs.changes-not-docs.outputs.otherChangesFound == 'false') }} + steps: + - run: echo "No-op job to trigger the required checks."