Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
127d920
Fix ctrl-c/esc while Authenticating. (#7879)
scidomino Sep 6, 2025
c031f53
chore(release): v0.3.4 (#7902)
SandyTao520 Sep 6, 2025
6b4c12e
Allow for slash commands to opt-out of autocompletion and /help disco…
dewitt Sep 6, 2025
6a9c285
add(logging): Add OTel logging for counting chars (#7903)
kiranani Sep 7, 2025
d308291
bug(core): Fix `Check Bundle Size` github action. (#7833)
joshualitt Sep 7, 2025
d33defd
Mention replacements for deprecated settings in settings.json (#7913)
jacob314 Sep 7, 2025
6e26c88
Pull contentGenerator out of GeminiClient and into Config. (#7825)
scidomino Sep 7, 2025
4693137
fix(ui): disable input prompt during tool confirmation (#7935)
Lyonk71 Sep 7, 2025
009c24a
feat(settings): Add support for settings `enum` options (#7719)
richieforeman Sep 8, 2025
1788f04
fix(ide): fix crash on windows when null command is returned (#8007)
skeshive Sep 8, 2025
78142ea
fix: hide tips when folder trust dialog is open (#7394)
hritan Sep 8, 2025
7e56cc6
Move scope settings to new dialog (#7836)
miguelsolorio Sep 8, 2025
c244cc8
fix(ide companion extension): increase payload size (#8029)
skeshive Sep 8, 2025
9c71d3d
Skip bundle_size job for merge_group event (#8032)
bobcatfish Sep 8, 2025
f6f2fff
refactor: Centralize and improve model fallback handling (#7634)
abhipatel12 Sep 8, 2025
c8dfab9
Fix maxOutputTokens compression bug. (#8026)
scidomino Sep 8, 2025
097b5c7
fix: Restart logic in useFolderTrust hook (#8038)
shrutip90 Sep 8, 2025
f0bbfe5
feat(core): Download ripgrep at runtime, if enabled. (#7818)
joshualitt Sep 8, 2025
2b05cf3
Allow users to type while waiting for MCP servers (#8021)
scidomino Sep 8, 2025
471cbcd
Remove org/repo install support (#7815)
chrstnb Sep 9, 2025
1eaf21f
refactor(core): Introduce LlmUtilityService and promptIdContext (#7952)
abhipatel12 Sep 9, 2025
ef9469a
feat(commands): Add new commands for docs, git, and PR review (#7853)
allenhutchison Sep 9, 2025
02f67d3
Add clearcut logging for extensions install command (#8057)
chrstnb Sep 9, 2025
9418711
refactor(ide): extract IDE context types into a separate file (#8037)
skeshive Sep 9, 2025
5474495
feat(core): Only summarize long tool output for shell command (#8039)
SandyTao520 Sep 9, 2025
8b40e00
Update extensions docs (#8112)
chrstnb Sep 9, 2025
da58b93
feat: Add reusable EnumSelector UI component (split from #6832) (#7774)
hoteye Sep 9, 2025
de5a31c
Limit recursion when looking for .gitignore files (#8103)
bbiggs Sep 9, 2025
ae20aee
feat(ide): Update context filtering to be done CLI-side + update port…
skeshive Sep 9, 2025
7d77f02
[Part 1/6] feat(telemetry): add rate limiter and high-water mark trac…
eLyiN Sep 9, 2025
76182db
fix(ide companion extension): Don't show the installation confirmatio…
richieforeman Sep 10, 2025
5032b27
0.4.0 (#8136)
mattKorwel Sep 10, 2025
a31830a
Ignore workspace extensions in user extensions dir (#8084)
chrstnb Sep 10, 2025
0d03f4e
Release Process vNext (#8152)
mattKorwel Sep 10, 2025
50e7c88
Extensions update command (#8100)
jakemac53 Sep 10, 2025
bd0f085
chore(a2a-server): if a2a task creation fails return error to user (#…
adamfweidman Sep 10, 2025
69b2d77
fix(cli): added directory name to folder trust dialog (#8165)
hritan Sep 10, 2025
ef70c17
Add functionality to check for git extension updates, as well as supp…
jakemac53 Sep 10, 2025
0e3a0d7
Add .geminiignore support to the glob tool. (#8086)
scidomino Sep 10, 2025
a3a0e98
docs: Add e2e status badge to main README πŸ… (#8198)
bobcatfish Sep 10, 2025
b9b6fe1
feat(ui): Semantic tokens refactor (#8087)
miguelsolorio Sep 10, 2025
30b13c6
fix(#7039): broken IDE integration for multi-edit/multi-write flows (…
hugomurillomtz Sep 10, 2025
ff705ec
fix(settings): use union merge for excludeTools (#7842)
spencerschrock Sep 10, 2025
de2903b
fix: make `bfsFileSearch` more efficient (#8173)
gsquared94 Sep 10, 2025
b1b20e5
Update README.md (#8199)
OakNinja Sep 10, 2025
32abe90
Fix: connect on docker devcontainer to vscode-ide (#7464)
dtometzki Sep 10, 2025
db99fc7
fix: `gitignore` handling (#8177)
gsquared94 Sep 10, 2025
514767c
Structured JSON Output (#8119)
jerop Sep 10, 2025
3ceefe8
fix(rendering): remove React.strictMode from gemini.tsx (#8145)
galz10 Sep 10, 2025
03e3c59
Fix compression issues (#8225)
scidomino Sep 10, 2025
8cc787f
Fix suggestion alignment (#8233)
miguelsolorio Sep 11, 2025
5b21767
feat: add cached string width function for performance optimization (…
jacob314 Sep 11, 2025
78744cf
feat(ui): Add confirmation dialog for disabling loop detection for cu…
SandyTao520 Sep 11, 2025
8f4321b
feat: add telemetry for output format usage (#8223)
jerop Sep 11, 2025
095351b
feat(telemetry): Add content length to tool calls and log tool output…
SandyTao520 Sep 11, 2025
f9f4b2a
Broaden PR Approval Process (#8264)
mattKorwel Sep 11, 2025
1819ffe
feat(release): automate patch creation and release process (#8202)
mattKorwel Sep 11, 2025
1291ec7
Update package-lock.json to reflect recently removed deps (#8271)
scidomino Sep 11, 2025
ba85aa4
feat(core): Tool Confirmation Message Bus foundation (PR 1 of 3) (#7835)
allenhutchison Sep 11, 2025
6be0545
feat(ui): make accept edits & yolo mode match shell mode styles (#8200)
miguelsolorio Sep 11, 2025
5504f93
fix(metrics) - Remove the error field from ApiResponseEvent (#8207)
shishu314 Sep 11, 2025
538e6cd
feat(routing): Initialize model routing architecture (#8153)
abhipatel12 Sep 11, 2025
d892cde
Refactor IdeContextStore (#8278)
scidomino Sep 11, 2025
0308267
fix(trust): Pass folderTrust config to a2a server (#8082)
shishu314 Sep 11, 2025
ad21c10
Fix MCP prompt slash commands not appearing. (#8290)
scidomino Sep 11, 2025
39af711
Move IdeClient.connect() to initializeApp(). (#8282)
scidomino Sep 11, 2025
59182a9
feat(core): Copy `downloadRipGrep` with license. (#8195)
joshualitt Sep 11, 2025
8969a23
feat(ide): Check for IDE diffing capabilities before opening diffs (#…
skeshive Sep 11, 2025
181898c
feat(shell): enable interactive commands with virtual terminal (#6694)
galz10 Sep 11, 2025
aba2a99
fix(core): Default skipNextSpeakerCheck to true when the setting is n…
SandyTao520 Sep 11, 2025
67f7dae
Update default text styles (#8291)
miguelsolorio Sep 11, 2025
1be38d8
fix(core): Improve compression message clarity for small history case…
ShammiAnand Sep 11, 2025
b2c3523
fix(release): Add back old release.yml (#8302)
SandyTao520 Sep 11, 2025
2ccb983
feat(core): Re-download `rg` binary if it is deleted. (#8126)
joshualitt Sep 11, 2025
557dba4
Fix license file. (#8284)
joshualitt Sep 11, 2025
6803559
feat(core): Enable ripgrep by default. (#7427)
joshualitt Sep 11, 2025
fe146c4
chore(release): v0.7.0-nightly.20250912.68035591
gemini-cli-robot Sep 12, 2025
4db385a
Merge branch 'main' into feat/nightly
tomi-stipancik Sep 14, 2025
2e8f339
Rename for blocks
tomi-stipancik Sep 14, 2025
37a8c90
fix names
tomi-stipancik Sep 14, 2025
e527935
Add stream-json output format
tomi-stipancik Sep 14, 2025
0af22ea
Merge pull request #3 from BlocksOrg/feat/stream-json
tomi-stipancik Sep 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .gemini/commands/find-docs.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
description = "Find relevant documentation and output GitHub URLs."

prompt = """
## Mission: Find Relevant Documentation

Your task is to find documentation files relevant to the user's question within the current git repository and provide a list of GitHub URLs to view them.

### Workflow:

1. **Identify Repository Details**:
* You may use shell commands like `git` or `gh` to get the remote URL of the repository.
* From the remote URL, parse and construct the base GitHub URL (e.g., `https://github.com/user/repo`). You must handle both HTTPS (`https://github.com/user/repo.git`) and SSH (`[email protected]:user/repo.git`) formats.
* Determine the default branch name. You can assume `main` for this purpose, as it is the most common.

2. **Search for Documentation**:
* First, perform a targeted search across the repository for documentation files (e.g., `.md`, `.mdx`) that seem directly related to the user's question.
* If this initial search yields no relevant results, and a `docs/` directory exists, read the content of all files within the `docs/` directory to find relevant information.
* If you still can't find a direct match, broaden your search to include related concepts and synonyms of the keywords in the user's question.
* For each file you identify as potentially relevant, read its content to confirm it addresses the user's query.

3. **Construct and Output URLs**:
* For each file you identify as relevant, construct the full GitHub URL by combining the base URL, branch, and file path. **Do not use shell commands for this step.**
* The URL format should be: `{BASE_GITHUB_URL}/blob/{BRANCH_NAME}/{PATH_TO_FILE_FROM_REPO_ROOT}`.
* Present the final list to the user as a markdown list. Each item in the list should be the URL to the document, followed by a short summary of its content.
* If, after all search attempts, you cannot find any relevant documentation, ask the user clarifying questions to better understand their needs. Do not return any URLs in this case.

### QUESTION:

{{args}}
"""
13 changes: 13 additions & 0 deletions .gemini/commands/github/cleanup-back-to-main.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
description = "Go back to main and clean up the branch."

prompt = """
I'm done with the work on this branch, and I'm ready to go back to main and clean up.

Here is the workflow I'd like you to follow:

1. **Get Current Branch:** First, I need you to get the name of the current branch and save it.
2. **Branch Check:** Check if the current branch is `main`. If it is, I need you to stop and let me know.
3. **Go to Main:** Next, I need you to checkout the main branch.
4. **Pull Latest:** Once you are on the main branch, I need you to pull down the latest changes to make sure I'm up to date.
5. **Branch Cleanup:** Finally, I need you to delete the branch that you noted in the first step.
"""
47 changes: 47 additions & 0 deletions .gemini/commands/oncall/pr-review.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
description = "Review a specific pull request"

prompt = """
## Mission: Comprehensive Pull Request Review

Today, our mission is to meticulously review community pull requests (PRs) for this project. We will proceed systematically, evaluating each candidate PR for its quality, adherence to standards, and readiness for merging.

### Workflow:

1. **PR Preparation & Initial Assessment**:
* **You will check out the designated PR {{args}}** into a temporary branch.
* **Execute the preflight checks (`npm run preflight`)**. This includes building, linting, and running all unit tests.
* Analyze the output of these preflight checks, noting any failures, warnings, or linting issues.

2. **In-Depth Code Review**:
* **Your primary role is to conduct a thorough and in-depth code review** of the changes introduced in the PR. Focus your analysis on the following criteria:
* **Correctness**: Does the code achieve its stated purpose without bugs or logical errors?
* **Maintainability**: Is the code clean, well-structured, and easy to understand and modify in the future? Consider factors like code clarity, modularity, and adherence to established design patterns.
* **Readability**: Is the code well-commented (where necessary) and consistently formatted according to our project's coding style guidelines?
* **Efficiency**: Are there any obvious performance bottlenecks or resource inefficiencies introduced by the changes?
* **Security**: Are there any potential security vulnerabilities or insecure coding practices?
* **Edge Cases and Error Handling**: Does the code appropriately handle edge cases and potential errors?
* **Testability**: Is the new or modified code adequately covered by tests (even if preflight checks pass)? Suggest additional test cases that would improve coverage or robustness.
* Based on your analysis, you will determine if the PR is **safe to merge**.

3. **Reviewing Previous Feedback**:
* **Access and examine the PR's history** to identify any **outstanding requests or unresolved comments from previous reviews**. Incorporate these into your current review and explicitly highlight if they have been adequately addressed in the current state of the PR.

4. **Decision and Output Generation**:
* **If the PR is deemed safe to merge** (after your comprehensive review and considering previous feedback):
* Draft a **friendly, concise, and professional approval message**.
* **The approval message should:**
* Clearly state that the PR is approved.
* Briefly acknowledge the quality or value of the contribution (e.g., "Great work on X feature!" or "Appreciate the fix for Y issue!").
* **Do NOT mention the preflight checks or unit testing**, as these are internal processes.
* Be suitable for public display on GitHub.
* **If the PR is NOT safe to merge**:
* Provide a **clear, constructive, and detailed summary of the issues found**.
* Suggest **specific actionable changes** required for the PR to become merge-ready.
* Ensure the feedback is professional and encourages the contributor.

### Post-PR Action:

* After providing your review and decision for the current PR, I will wait for you to perform any manual testing you wish to do. Please let me know when you are finished.
* Once you have confirmed that you are done, I will switch to the `main` branch, clean up the local branch, and perform a pull to ensure we are synchronized with the latest upstream changes for the next review.

"""
18 changes: 13 additions & 5 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
# By default, require reviews from the release approvers for all files.
* @google-gemini/gemini-cli-askmode-approvers
# By default, require reviews from the maintainers for all files.
* @google-gemini/gemini-cli-maintainers

# The following files don't need reviews from the release approvers.
# Require reviews from the release approvers for critical files.
# These patterns override the rule above.
**/*.md
/docs/
/package.json @google-gemini/gemini-cli-askmode-approvers
/package-lock.json @google-gemini/gemini-cli-askmode-approvers
/GEMINI.md @google-gemini/gemini-cli-askmode-approvers
/SECURITY.md @google-gemini/gemini-cli-askmode-approvers
/LICENSE @google-gemini/gemini-cli-askmode-approvers
/.github/workflows/ @google-gemini/gemini-cli-askmode-approvers
/packages/cli/package.json @google-gemini/gemini-cli-askmode-approvers
/packages/cli/package-lock.json @google-gemini/gemini-cli-askmode-approvers
/packages/core/package.json @google-gemini/gemini-cli-askmode-approvers
/packages/core/package-lock.json @google-gemini/gemini-cli-askmode-approvers
99 changes: 99 additions & 0 deletions .github/actions/publish-release/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: 'Publish Release'
description: 'Builds, prepares, and publishes the gemini-cli packages to npm and creates a GitHub release.'

inputs:
release-version:
description: 'The version to release (e.g., 0.1.11).'
required: true
npm-tag:
description: 'The npm tag to publish with (e.g., latest, preview, nightly).'
required: true
wombat-token-core:
description: 'The npm token for the @blocksuser/gemini-cli-core package.'
required: true
wombat-token-cli:
description: 'The npm token for the @blocksuser/gemini-cli package.'
required: true
github-token:
description: 'The GitHub token for creating the release.'
required: true
dry-run:
description: 'Whether to run in dry-run mode.'
required: true
release-branch:
description: 'The branch to target for the release.'
required: true
previous-tag:
description: 'The previous tag to use for generating release notes.'
required: true
working-directory:
description: 'The working directory to run the steps in.'
required: false
default: '.'

runs:
using: 'composite'
steps:
- name: 'Build and Prepare Packages'
working-directory: '${{ inputs.working-directory }}'
run: |-
npm run build:packages
npm run prepare:package
shell: 'bash'

- name: 'Configure npm for publishing'
uses: 'actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020'
with:
node-version-file: '${{ inputs.working-directory }}/.nvmrc'
registry-url: 'https://wombat-dressing-room.appspot.com'
scope: '@google'

- name: 'Publish @blocksuser/gemini-cli-core'
working-directory: '${{ inputs.working-directory }}'
env:
NODE_AUTH_TOKEN: '${{ inputs.wombat-token-core }}'
run: |-
npm publish \
--dry-run="${{ inputs.dry-run }}" \
--workspace="@blocksuser/gemini-cli-core" \
--tag="${{ inputs.npm-tag }}"
shell: 'bash'

- name: 'Install latest core package'
working-directory: '${{ inputs.working-directory }}'
if: '${{ inputs.dry-run == "false" }}'
run: |-
npm install "@blocksuser/gemini-cli-core@${{ inputs.release-version }}" \
--workspace="@blocksuser/gemini-cli" \
--save-exact
shell: 'bash'

- name: 'Publish @blocksuser/gemini-cli'
working-directory: '${{ inputs.working-directory }}'
env:
NODE_AUTH_TOKEN: '${{ inputs.wombat-token-cli }}'
run: |-
npm publish \
--dry-run="${{ inputs.dry-run }}" \
--workspace="@blocksuser/gemini-cli" \
--tag="${{ inputs.npm-tag }}"
shell: 'bash'

- name: 'Bundle'
working-directory: '${{ inputs.working-directory }}'
run: 'npm run bundle'
shell: 'bash'

- name: 'Create GitHub Release'
working-directory: '${{ inputs.working-directory }}'
if: '${{ inputs.dry-run == "false" }}'
env:
GITHUB_TOKEN: '${{ inputs.github-token }}'
run: |-
gh release create "v${{ inputs.release-version }}" \
bundle/gemini.js \
--target "${{ inputs.release-branch }}" \
--title "Release v${{ inputs.release-version }}" \
--notes-start-tag "${{ inputs.previous-tag }}" \
--generate-notes
shell: 'bash'
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,8 @@ jobs:
# Check for changes in bundle size.
bundle_size:
name: 'Check Bundle Size'
if: |-
${{ github.event_name != 'merge_group' }}
runs-on: 'ubuntu-latest'
permissions:
contents: 'read' # For checkout
Expand All @@ -392,3 +394,4 @@ jobs:
pattern: './bundle/**/*.{js,sb}'
minimum-change-threshold: '1000'
compression: 'none'
clean-script: 'clean'
58 changes: 58 additions & 0 deletions .github/workflows/create-patch-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: 'Create Patch PR'

on:
workflow_dispatch:
inputs:
commit:
description: 'The commit SHA to cherry-pick for the patch.'
required: true
type: 'string'
channel:
description: 'The release channel to patch.'
required: true
type: 'choice'
options:
- 'stable'
- 'preview'
dry_run:
description: 'Whether to run in dry-run mode.'
required: false
type: 'boolean'
default: false

jobs:
create-patch:
runs-on: 'ubuntu-latest'
permissions:
contents: 'write'
pull-requests: 'write'
steps:
- name: 'Checkout'
uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8' # ratchet:actions/checkout@v5
with:
fetch-depth: 0

- name: 'Setup Node.js'
uses: 'actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020' # ratchet:actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'

- name: 'Install Dependencies'
run: 'npm ci'

- name: 'Configure Git User'
run: |-
git config user.name "gemini-cli-robot"
git config user.email "[email protected]"

- name: 'Create Patch for Stable'
if: "github.event.inputs.channel == 'stable'"
env:
GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
run: 'node scripts/create-patch-pr.js --commit=${{ github.event.inputs.commit }} --channel=stable --dry-run=${{ github.event.inputs.dry_run }}'

- name: 'Create Patch for Preview'
env:
GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
run: 'node scripts/create-patch-pr.js --commit=${{ github.event.inputs.commit }} --channel=${{ github.event.inputs.channel }} --dry-run=${{ github.event.inputs.dry_run }}'
53 changes: 53 additions & 0 deletions .github/workflows/nightly-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: 'Nightly Release'

on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
inputs:
dry_run:
description: 'Run a dry-run of the release process; no branches, npm packages or GitHub releases will be created.'
required: true
type: 'boolean'
default: true

jobs:
release:
runs-on: 'ubuntu-latest'
steps:
- name: 'Checkout'
uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8'
with:
fetch-depth: 0

- name: 'Setup Node.js'
uses: 'actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020' # ratchet:actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'

- name: 'Install Dependencies'
run: 'npm ci'

- name: 'Get Nightly Version'
id: 'nightly_version'
env:
GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
run: |
VERSION_JSON=$(node scripts/get-release-version.js --type=nightly)
echo "RELEASE_TAG=$(echo "${VERSION_JSON}" | jq -r .releaseTag)" >> "${GITHUB_OUTPUT}"
echo "RELEASE_VERSION=$(echo "${VERSION_JSON}" | jq -r .releaseVersion)" >> "${GITHUB_OUTPUT}"
echo "NPM_TAG=$(echo "${VERSION_JSON}" | jq -r .npmTag)" >> "${GITHUB_OUTPUT}"
echo "PREVIOUS_TAG=$(echo "${VERSION_JSON}" | jq -r .previousReleaseTag)" >> "${GITHUB_OUTPUT}"

- name: 'Publish Release'
uses: './.github/actions/publish-release'
with:
release-version: '${{ steps.nightly_version.outputs.RELEASE_VERSION }}'
npm-tag: '${{ steps.nightly_version.outputs.NPM_TAG }}'
wombat-token-core: '${{ secrets.WOMBAT_TOKEN_CORE }}'
wombat-token-cli: '${{ secrets.WOMBAT_TOKEN_CLI }}'
github-token: '${{ secrets.GITHUB_TOKEN }}'
dry-run: '${{ github.event.inputs.dry_run }}'
release-branch: 'main'
previous-tag: '${{ steps.nightly_version.outputs.PREVIOUS_TAG }}'
56 changes: 56 additions & 0 deletions .github/workflows/patch-from-comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: 'Patch from Comment'

on:
issue_comment:
types: ['created']

jobs:
slash-command:
runs-on: 'ubuntu-latest'
steps:
- name: 'Slash Command Dispatch'
id: 'slash_command'
uses: 'peter-evans/slash-command-dispatch@40877f718dce0101edfc7aea2b3800cc192f9ed5'
with:
token: '${{ secrets.GITHUB_TOKEN }}'
commands: 'patch'
permission: 'write'
issue-type: 'pull-request'
static-args: |
dry_run=false

- name: 'Get PR Status'
id: 'pr_status'
if: "steps.slash_command.outputs.dispatched == 'true'"
env:
GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
run: |
gh pr view "${{ github.event.issue.number }}" --json mergeCommit,state > pr_status.json
echo "MERGE_COMMIT_SHA=$(jq -r .mergeCommit.oid pr_status.json)" >> "$GITHUB_OUTPUT"
echo "STATE=$(jq -r .state pr_status.json)" >> "$GITHUB_OUTPUT"

- name: 'Dispatch if Merged'
if: "steps.pr_status.outputs.STATE == 'MERGED'"
uses: 'actions/github-script@00f12e3e20659f42342b1c0226afda7f7c042325'
with:
script: |
const args = JSON.parse('${{ steps.slash_command.outputs.command-arguments }}');
github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'create-patch-pr.yml',
ref: 'main',
inputs: {
commit: '${{ steps.pr_status.outputs.MERGE_COMMIT_SHA }}',
channel: args.channel,
dry_run: args.dry_run
}
})

- name: 'Comment on Failure'
if: "steps.pr_status.outputs.STATE != 'MERGED'"
uses: 'peter-evans/create-or-update-comment@67dcc547d311b736a8e6c5c236542148a47adc3d'
with:
issue-number: '${{ github.event.issue.number }}'
body: |
:x: The `/patch` command failed. This pull request must be merged before a patch can be created.
Loading
Loading