From 3236d1b148156d5987b3dd45a542ce501cfdf689 Mon Sep 17 00:00:00 2001 From: Waren Gonzaga Date: Wed, 25 Feb 2026 13:16:56 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9A=99=EF=B8=8F=20setup=20(ci):=20skip=20pac?= =?UTF-8?q?kage=20and=20container=20builds=20for=20Dependabot=20PRs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 4 ++++ .github/workflows/container.yml | 1 + .github/workflows/package.yml | 1 + 3 files changed, 6 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 94650ee..c68c417 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,6 +33,10 @@ jobs: if [ "$GITHUB_EVENT_BEFORE" = "0000000000000000000000000000000000000000" ]; then # Initial push has no valid "before" SHA, so capture all reachable commits COMMITS=$(git log --format="%s" "$GITHUB_EVENT_AFTER") + elif ! git cat-file -e "${GITHUB_EVENT_BEFORE}^{commit}" 2>/dev/null; then + # Force-push: before SHA no longer exists, validate only the latest commit + echo "⚠ Force-push detected — before SHA not found, validating HEAD commit only" + COMMITS=$(git log --format="%s" -1 "$GITHUB_EVENT_AFTER") else COMMITS=$(git log --format="%s" "${GITHUB_EVENT_BEFORE}..${GITHUB_EVENT_AFTER}") fi diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml index 7f8c171..4749f3a 100644 --- a/.github/workflows/container.yml +++ b/.github/workflows/container.yml @@ -18,6 +18,7 @@ permissions: jobs: build: + if: github.event_name != 'pull_request' || github.event.pull_request.user.login != 'dependabot[bot]' runs-on: ubuntu-latest steps: - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index b89fc93..01a96dc 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -22,6 +22,7 @@ permissions: jobs: publish: + if: github.event_name != 'pull_request' || github.event.pull_request.user.login != 'dependabot[bot]' runs-on: ubuntu-latest steps: - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4