Skip to content

feat: Add allow-empty input to support intentionally empty commits#137

Open
leifdreizler wants to merge 2 commits intografana:mainfrom
semgrep:allow-empty-upstream
Open

feat: Add allow-empty input to support intentionally empty commits#137
leifdreizler wants to merge 2 commits intografana:mainfrom
semgrep:allow-empty-upstream

Conversation

@leifdreizler
Copy link
Copy Markdown

semgrep#2 - my fork with passing tests

When allow-empty is true, the no-changes guard falls through to the existing empty-array placeholder logic and the GraphQL mutation runs, producing a commit whose tree equals its parent's. allow-empty supersedes success-if-no-changes, which is documented in both inputs' descriptions.

Also addresses #114 by adding success-if-no-changes (and the new allow-empty) to the docs/README.tmpl usage examples.

End-to-end verification

Beyond the in-repo test-allow-empty job, the updated action was wired into a real downstream workflow (leifdreizler/test-grafana-GHA) and run side-by-side against the unmodified upstream:

  • Empty commit produced via this PRrunresulting commit
  • Upstream grafana/github-api-commit-action@v1.0.0 rejects the same no-changes inputrun

leifdreizler and others added 2 commits May 8, 2026 12:27
When allow-empty is true, the no-changes guard falls through to the
existing empty-array placeholder logic and the GraphQL mutation runs,
producing a commit whose tree equals its parent's. allow-empty
supersedes success-if-no-changes, which is documented in both inputs'
descriptions.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Closes the docs gap noted in grafana#114 for
success-if-no-changes and documents the new allow-empty input in the
same step. allow-empty is listed first in the examples since it
supersedes success-if-no-changes, which makes the cross-reference in
the success-if-no-changes comment read naturally.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant