Skip to content

bug: contributors workflow fails with "invalid reference" after merge to main #12

Description

@udaycodespace

Description

The update-contributors.yml workflow (added in #11) fails at the
commit step every time a PR is merged into main. Confirmed on the
merge of #11 itself — workflow run failed with:

fatal: invalid reference: feat/issue-10-readme-contributors
Error: Invalid status code: 128

So the automation currently does not work end-to-end. This needs to be
fixed before we can trust it on future contributor merges.

Where to look

  • The failure happens in the git-auto-commit-action step, not in the
    Node script.
  • Think about what pull_request: closed events actually check out,
    and what branch reference GitHub exposes in that context versus what
    branch we actually want to update.
  • Compare what branch name shows up in the failing log versus what
    branch the workflow is supposed to be committing to.

Requirements

  • Identify the root cause of the invalid reference error
  • Fix the workflow so it reliably targets main regardless of which
    branch the merged PR came from
  • Test by simulating a merge (or verifying on the next real contributor
    PR) to confirm the README actually updates on main

Expected outcome

PR merged → workflow runs → commit lands on main → README updates,
no errors in the Actions log.

Tech area

GitHub Actions, YAML, git internals (branch refs on PR-closed events)

Metadata

Metadata

Assignees

Labels

ECSoC26Required label for a PR to be eligible for Sentinel scoringenhancementNew feature or improvement request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions