From a4b2df4836e3647cb3c6db8732afb1d0d46848df Mon Sep 17 00:00:00 2001 From: Aryanbuha890 Date: Fri, 17 Jul 2026 20:34:19 +0530 Subject: [PATCH] fix: resolve invalid reference error in contributors workflow (#12) On pull_request: closed events, the runner checks out the merged PR's source branch (e.g. feat/issue-10-readme-contributors) which is deleted after merge. git-auto-commit-action then fails with: fatal: invalid reference: feat/issue-10-readme-contributors Fix: - Add ref: main to actions/checkout so the job always works on main - Add branch: main to git-auto-commit-action so commits always land on main --- .github/workflows/update-contributors.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/update-contributors.yml b/.github/workflows/update-contributors.yml index a3d431f..a0197eb 100644 --- a/.github/workflows/update-contributors.yml +++ b/.github/workflows/update-contributors.yml @@ -21,6 +21,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 with: + ref: main fetch-depth: 0 - name: Setup Node.js @@ -39,5 +40,6 @@ jobs: with: commit_message: "docs: update contributors in README [skip ci]" file_pattern: "README.md" + branch: main commit_user_name: "github-actions[bot]" commit_user_email: "github-actions[bot]@users.noreply.github.com"