From 8422a6a6741bd4d1fc6bce9fe63583ed6a575607 Mon Sep 17 00:00:00 2001 From: daz Date: Thu, 14 Nov 2024 11:41:16 -0700 Subject: [PATCH] Avoid running workflow on forks --- .github/workflows/ci-update-dist.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-update-dist.yml b/.github/workflows/ci-update-dist.yml index 80c20f3..05d9b2c 100644 --- a/.github/workflows/ci-update-dist.yml +++ b/.github/workflows/ci-update-dist.yml @@ -14,6 +14,9 @@ permissions: jobs: update-dist: + # Only run for the Gradle repository; otherwise when users create pull requests from their `main` branch + # it would erroneously update `dist` on their branch (and the pull request) + if: github.repository == 'gradle/actions' permissions: contents: write runs-on: ubuntu-latest @@ -45,9 +48,6 @@ jobs: # Important: The push event will not trigger any other workflows, see # https://github.com/stefanzweifel/git-auto-commit-action?tab=readme-ov-file#commits-made-by-this-action-do-not-trigger-new-workflow-runs - name: Commit & push changes - # Only run for the Gradle repository; otherwise when users create pull requests from their `main` branch - # it would erroneously update `dist` on their branch (and the pull request) - if: github.repository == 'gradle/actions' uses: stefanzweifel/git-auto-commit-action@v5 with: commit_message: '[bot] Update dist directory'