From 0bec8721cca18cfd9c7477dda72dd5db2ad17849 Mon Sep 17 00:00:00 2001 From: stevenhorsman Date: Mon, 29 Apr 2024 13:45:32 +0100 Subject: [PATCH] workflow: Skip commit checks for dependabout Dependabot doesn't follow all our commit format guidelines, so add a check and skip these if the author is `dependabot[bot]` Signed-off-by: stevenhorsman --- .github/workflows/commit-message-check.yaml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/commit-message-check.yaml b/.github/workflows/commit-message-check.yaml index 177709f84c..6a51f03974 100644 --- a/.github/workflows/commit-message-check.yaml +++ b/.github/workflows/commit-message-check.yaml @@ -19,6 +19,8 @@ env: jobs: commit-message-check: runs-on: ubuntu-latest + env: + PR_AUTHOR: ${{ github.event.pull_request.user.login }} name: Commit Message Check steps: - name: Get PR Commits @@ -47,7 +49,7 @@ jobs: commits: ${{ steps.get-pr-commits.outputs.commits }} - name: Check Subject Line Length - if: ${{ !contains(github.event.pull_request.labels.*.name, 'force-skip-ci') && ( success() || failure() ) }} + if: ${{ (env.PR_AUTHOR != 'dependabot[bot]') && !contains(github.event.pull_request.labels.*.name, 'force-skip-ci') && ( success() || failure() ) }} uses: tim-actions/commit-message-checker-with-regex@v0.3.1 with: commits: ${{ steps.get-pr-commits.outputs.commits }} @@ -56,7 +58,7 @@ jobs: post_error: ${{ env.error_msg }} - name: Check Body Line Length - if: ${{ !contains(github.event.pull_request.labels.*.name, 'force-skip-ci') && ( success() || failure() ) }} + if: ${{ (env.PR_AUTHOR != 'dependabot[bot]') && !contains(github.event.pull_request.labels.*.name, 'force-skip-ci') && ( success() || failure() ) }} uses: tim-actions/commit-message-checker-with-regex@v0.3.1 with: commits: ${{ steps.get-pr-commits.outputs.commits }} @@ -87,7 +89,7 @@ jobs: post_error: ${{ env.error_msg }} - name: Check Subsystem - if: ${{ !contains(github.event.pull_request.labels.*.name, 'force-skip-ci') && ( success() || failure() ) }} + if: ${{ (env.PR_AUTHOR != 'dependabot[bot]') && !contains(github.event.pull_request.labels.*.name, 'force-skip-ci') && ( success() || failure() ) }} uses: tim-actions/commit-message-checker-with-regex@v0.3.1 with: commits: ${{ steps.get-pr-commits.outputs.commits }}