From 033518a51f9eda2bb3632156c9de215b88eb3756 Mon Sep 17 00:00:00 2001 From: James McKinney <26463+jpmckinney@users.noreply.github.com> Date: Thu, 28 Mar 2024 19:45:35 -0400 Subject: [PATCH] cookiecutter(ci): Prevent workflow from running if pre-commit-ci[bot] performs autofix --- .../.github/workflows/automerge.yml | 4 ++-- .../.github/workflows/automerge.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cookiecutter-django/{{cookiecutter.project_slug}}/.github/workflows/automerge.yml b/cookiecutter-django/{{cookiecutter.project_slug}}/.github/workflows/automerge.yml index f42ede0..5536573 100644 --- a/cookiecutter-django/{{cookiecutter.project_slug}}/.github/workflows/automerge.yml +++ b/cookiecutter-django/{{cookiecutter.project_slug}}/.github/workflows/automerge.yml @@ -8,7 +8,7 @@ permissions: contents: write # to merge the PR jobs: dependabot: - if: ${{ github.actor == 'dependabot[bot]' }} + if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' }} runs-on: ubuntu-latest steps: - id: dependabot-metadata @@ -24,7 +24,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: gh pr merge --auto --squash ${{ github.event.pull_request.html_url }} precommit: - if: ${{ github.actor == 'pre-commit-ci[bot]' }} + if: ${{ github.event.pull_request.user.login == 'pre-commit-ci[bot]' }} runs-on: ubuntu-latest steps: - env: diff --git a/cookiecutter-pypackage/{{cookiecutter.repository_name}}/.github/workflows/automerge.yml b/cookiecutter-pypackage/{{cookiecutter.repository_name}}/.github/workflows/automerge.yml index f42ede0..5536573 100644 --- a/cookiecutter-pypackage/{{cookiecutter.repository_name}}/.github/workflows/automerge.yml +++ b/cookiecutter-pypackage/{{cookiecutter.repository_name}}/.github/workflows/automerge.yml @@ -8,7 +8,7 @@ permissions: contents: write # to merge the PR jobs: dependabot: - if: ${{ github.actor == 'dependabot[bot]' }} + if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' }} runs-on: ubuntu-latest steps: - id: dependabot-metadata @@ -24,7 +24,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: gh pr merge --auto --squash ${{ github.event.pull_request.html_url }} precommit: - if: ${{ github.actor == 'pre-commit-ci[bot]' }} + if: ${{ github.event.pull_request.user.login == 'pre-commit-ci[bot]' }} runs-on: ubuntu-latest steps: - env: