Skip to content

feat(ci): add --format={text,shell,json} to ci git-refs#1223

Merged
mergify[bot] merged 1 commit intomainfrom
devs/sileht/git-refs-better/add-format-text-shell-json-ci-git-refs--10e0ba97
Apr 20, 2026
Merged

feat(ci): add --format={text,shell,json} to ci git-refs#1223
mergify[bot] merged 1 commit intomainfrom
devs/sileht/git-refs-better/add-format-text-shell-json-ci-git-refs--10e0ba97

Conversation

@sileht
Copy link
Copy Markdown
Member

@sileht sileht commented Apr 18, 2026

Lets users consume detected refs in scripts without awk-parsing. Shell
format emits MERGIFY_GIT_REFS_{BASE,HEAD,SOURCE}=... lines suitable for
eval, with shlex-quoted values; json emits a single-line object.

Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

Copilot AI review requested due to automatic review settings April 18, 2026 22:21
@mergify mergify Bot had a problem deploying to Mergify Merge Protections April 18, 2026 22:21 Failure
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Apr 18, 2026

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🟢 🤖 Continuous Integration

Wonderful, this rule succeeded.
  • all of:
    • check-success=ci-gate

🟢 👀 Review Requirements

Wonderful, this rule succeeded.
  • any of:
    • #approved-reviews-by>=2
    • author = dependabot[bot]
    • author = mergify-ci-bot
    • author = renovate[bot]

🟢 Enforce conventional commit

Wonderful, this rule succeeded.

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\(.+\))?:

🟢 🔎 Reviews

Wonderful, this rule succeeded.
  • #changes-requested-reviews-by = 0
  • #review-requested = 0
  • #review-threads-unresolved = 0

🟢 📕 PR description

Wonderful, this rule succeeded.
  • body ~= (?ms:.{48,})

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds machine-consumable output formats to mergify ci git-refs so scripts can consume detected refs without parsing human-readable text.

Changes:

  • Add --format={text,shell,json} to mergify ci git-refs
  • Extend CLI tests to cover shell and json output modes
  • Update skills/mergify-ci documentation with usage examples for new formats

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
mergify_cli/ci/cli.py Implements --format option and emits refs in text/shell/JSON formats.
mergify_cli/tests/ci/test_cli.py Adds assertions and new tests for the additional output formats.
skills/mergify-ci/SKILL.md Documents the new output formats and shows scripting examples.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread mergify_cli/ci/cli.py
Comment thread mergify_cli/ci/cli.py
Comment thread mergify_cli/ci/cli.py
Comment thread skills/mergify-ci/SKILL.md Outdated
Comment thread mergify_cli/tests/ci/test_cli.py Outdated
@mergify mergify Bot requested a review from a team April 18, 2026 22:27
Lets users consume detected refs in scripts without awk-parsing. Shell
format emits MERGIFY_GIT_REFS_{BASE,HEAD,SOURCE}=... lines suitable for
`eval`, with shlex-quoted values; json emits a single-line object.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Change-Id: I10e0ba970faf5e0b6e69d72544dba4835e72ca8d
@sileht sileht force-pushed the devs/sileht/git-refs-better/add-format-text-shell-json-ci-git-refs--10e0ba97 branch from fcaa1a8 to ee7e9b0 Compare April 18, 2026 22:37
@sileht
Copy link
Copy Markdown
Member Author

sileht commented Apr 18, 2026

This pull request is part of a Mergify stack:

# Pull Request Link
1 feat(ci): add --format={text,shell,json} to ci git-refs #1223 👈
2 fix(ci): write empty string to GITHUB_OUTPUT when base is undetected #1225

@sileht
Copy link
Copy Markdown
Member Author

sileht commented Apr 18, 2026

Revision history

# Type Changes Date
1 initial fcaa1a8 2026-04-18 22:37 UTC
2 content fcaa1a8 → ee7e9b0 2026-04-18 22:37 UTC

@mergify mergify Bot deployed to Mergify Merge Protections April 18, 2026 22:38 Active
@sileht sileht marked this pull request as ready for review April 18, 2026 22:40
@mergify mergify Bot requested a review from a team April 19, 2026 06:44
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Apr 20, 2026

Merge Queue Status

This pull request spent 5 minutes 36 seconds in the queue, including 5 minutes 22 seconds running CI.

Required conditions to merge

mergify Bot added a commit that referenced this pull request Apr 20, 2026
@mergify mergify Bot added the queued label Apr 20, 2026
mergify Bot added a commit that referenced this pull request Apr 20, 2026
@mergify mergify Bot merged commit c5d113e into main Apr 20, 2026
11 checks passed
@mergify mergify Bot deleted the devs/sileht/git-refs-better/add-format-text-shell-json-ci-git-refs--10e0ba97 branch April 20, 2026 10:12
@mergify mergify Bot removed the queued label Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants