mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-12 12:54:07 -07:00
permission
This commit is contained in:
@@ -0,0 +1,54 @@
|
|||||||
|
name: 'Create and Merge Pull Request'
|
||||||
|
description: 'Creates a pull request and merges it automatically.'
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
branch-name:
|
||||||
|
description: 'The name of the branch to create the PR from.'
|
||||||
|
required: true
|
||||||
|
pr-title:
|
||||||
|
description: 'The title of the pull request.'
|
||||||
|
required: true
|
||||||
|
pr-body:
|
||||||
|
description: 'The body of the pull request.'
|
||||||
|
required: true
|
||||||
|
base-branch:
|
||||||
|
description: 'The branch to merge into.'
|
||||||
|
required: true
|
||||||
|
default: 'main'
|
||||||
|
app-id:
|
||||||
|
description: 'The ID of the GitHub App.'
|
||||||
|
required: true
|
||||||
|
private-key:
|
||||||
|
description: 'The private key of the GitHub App.'
|
||||||
|
required: true
|
||||||
|
dry-run:
|
||||||
|
description: 'Whether to run in dry-run mode.'
|
||||||
|
required: false
|
||||||
|
default: 'false'
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: 'composite'
|
||||||
|
steps:
|
||||||
|
- name: 'Generate GitHub App Token'
|
||||||
|
id: 'generate_token'
|
||||||
|
if: "inputs.dry-run == 'false'"
|
||||||
|
uses: 'actions/create-github-app-token@a8d616148505b5069dccd32f177bb87d7f39123b'
|
||||||
|
with:
|
||||||
|
app-id: '${{ inputs.app-id }}'
|
||||||
|
private-key: '${{ inputs.private-key }}'
|
||||||
|
permission-pull-requests: 'write'
|
||||||
|
permission-contents: 'write'
|
||||||
|
|
||||||
|
- name: 'Create and Approve Pull Request'
|
||||||
|
if: "inputs.dry-run == 'false'"
|
||||||
|
env:
|
||||||
|
GH_TOKEN: '${{ steps.generate_token.outputs.token }}'
|
||||||
|
shell: 'bash'
|
||||||
|
run: |
|
||||||
|
gh pr create \
|
||||||
|
--title "${{ inputs.pr-title }}" \
|
||||||
|
--body "${{ inputs.pr-body }}" \
|
||||||
|
--base "${{ inputs.base-branch }}" \
|
||||||
|
--head "${{ inputs.branch-name }}" \
|
||||||
|
--fill
|
||||||
|
gh pr merge --auto --squash
|
||||||
@@ -46,13 +46,22 @@ jobs:
|
|||||||
git config user.name "gemini-cli-robot"
|
git config user.name "gemini-cli-robot"
|
||||||
git config user.email "gemini-cli-robot@google.com"
|
git config user.email "gemini-cli-robot@google.com"
|
||||||
|
|
||||||
|
- name: 'Generate GitHub App Token'
|
||||||
|
id: 'generate_token'
|
||||||
|
uses: 'actions/create-github-app-token@a8d616148505b5069dccd32f177bb87d7f39123b'
|
||||||
|
with:
|
||||||
|
app-id: '${{ secrets.APP_ID }}'
|
||||||
|
private-key: '${{ secrets.PRIVATE_KEY }}'
|
||||||
|
permission-pull-requests: 'write'
|
||||||
|
permission-contents: 'write'
|
||||||
|
|
||||||
- name: 'Create Patch for Stable'
|
- name: 'Create Patch for Stable'
|
||||||
if: "github.event.inputs.channel == 'stable'"
|
if: "github.event.inputs.channel == 'stable'"
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
|
GH_TOKEN: '${{ steps.generate_token.outputs.token }}'
|
||||||
run: 'node scripts/create-patch-pr.js --commit=${{ github.event.inputs.commit }} --channel=stable --dry-run=${{ github.event.inputs.dry_run }}'
|
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'
|
- name: 'Create Patch for Preview'
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
|
GH_TOKEN: '${{ steps.generate_token.outputs.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 }}'
|
run: 'node scripts/create-patch-pr.js --commit=${{ github.event.inputs.commit }} --channel=${{ github.event.inputs.channel }} --dry-run=${{ github.event.inputs.dry_run }}'
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ jobs:
|
|||||||
contents: 'write'
|
contents: 'write'
|
||||||
packages: 'write'
|
packages: 'write'
|
||||||
issues: 'write'
|
issues: 'write'
|
||||||
|
pull-requests: 'write'
|
||||||
steps:
|
steps:
|
||||||
- name: 'Checkout'
|
- name: 'Checkout'
|
||||||
uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8'
|
uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8'
|
||||||
@@ -73,6 +74,16 @@ jobs:
|
|||||||
dry-run: '${{ github.event.inputs.dry_run }}'
|
dry-run: '${{ github.event.inputs.dry_run }}'
|
||||||
previous-tag: '${{ steps.nightly_version.outputs.PREVIOUS_TAG }}'
|
previous-tag: '${{ steps.nightly_version.outputs.PREVIOUS_TAG }}'
|
||||||
|
|
||||||
|
- name: 'Create and Merge Pull Request'
|
||||||
|
uses: './.github/actions/create-pull-request'
|
||||||
|
with:
|
||||||
|
branch-name: 'release/${{ steps.nightly_version.outputs.RELEASE_TAG }}'
|
||||||
|
pr-title: 'chore(release): bump version to ${{ steps.nightly_version.outputs.RELEASE_VERSION }}'
|
||||||
|
pr-body: 'Automated version bump for nightly release.'
|
||||||
|
app-id: '${{ secrets.APP_ID }}'
|
||||||
|
private-key: '${{ secrets.PRIVATE_KEY }}'
|
||||||
|
dry-run: '${{ github.event.inputs.dry_run }}'
|
||||||
|
|
||||||
- name: 'Create Issue on Failure'
|
- name: 'Create Issue on Failure'
|
||||||
if: '${{ failure() && github.event.inputs.dry_run == false }}'
|
if: '${{ failure() && github.event.inputs.dry_run == false }}'
|
||||||
env:
|
env:
|
||||||
|
|||||||
@@ -317,20 +317,15 @@ jobs:
|
|||||||
echo "Dry run enabled. Skipping push."
|
echo "Dry run enabled. Skipping push."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: 'Create and Approve Pull Request'
|
- name: 'Create and Merge Pull Request'
|
||||||
if: |-
|
uses: './.github/actions/create-pull-request'
|
||||||
${{ github.event.inputs.dry_run == 'false' }}
|
with:
|
||||||
env:
|
branch-name: '${{ steps.release_branch.outputs.BRANCH_NAME }}'
|
||||||
GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
|
pr-title: 'chore(release): bump version to ${{ needs.calculate-versions.outputs.NEXT_NIGHTLY_VERSION }}'
|
||||||
BRANCH_NAME: '${{ steps.release_branch.outputs.BRANCH_NAME }}'
|
pr-body: 'Automated version bump to prepare for the next nightly release.'
|
||||||
run: |
|
app-id: '${{ secrets.APP_ID }}'
|
||||||
gh pr create \
|
private-key: '${{ secrets.PRIVATE_KEY }}'
|
||||||
--title "chore(release): bump version to ${{ needs.calculate-versions.outputs.NEXT_NIGHTLY_VERSION }}" \
|
dry-run: '${{ github.event.inputs.dry_run }}'
|
||||||
--body "Automated version bump to prepare for the next nightly release." \
|
|
||||||
--base "main" \
|
|
||||||
--head "${BRANCH_NAME}" \
|
|
||||||
--fill
|
|
||||||
gh pr merge --auto --squash
|
|
||||||
|
|
||||||
- name: 'Create Issue on Failure'
|
- name: 'Create Issue on Failure'
|
||||||
if: '${{ failure() && github.event.inputs.dry_run == false }}'
|
if: '${{ failure() && github.event.inputs.dry_run == false }}'
|
||||||
|
|||||||
Reference in New Issue
Block a user