# Generated from xtask::workflows::cherry_pick
# Rebuild with `cargo xtask workflows`.
name: cherry_pick
run-name: 'cherry_pick to ${{ inputs.channel }} #${{ inputs.pr_number }}'
on:
  workflow_dispatch:
    inputs:
      commit:
        description: commit
        required: true
        type: string
      branch:
        description: branch
        required: true
        type: string
      channel:
        description: channel
        required: true
        type: string
      pr_number:
        description: pr_number
        required: true
        type: string
jobs:
  run_cherry_pick:
    runs-on: namespace-profile-2x4-ubuntu-2404
    steps:
    - name: steps::checkout_repo
      uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
      with:
        clean: false
    - id: generate-token
      name: steps::authenticate_as_zippy
      uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859
      with:
        app-id: ${{ secrets.ZED_ZIPPY_APP_ID }}
        private-key: ${{ secrets.ZED_ZIPPY_APP_PRIVATE_KEY }}
        permission-contents: write
        permission-workflows: write
    - name: cherry_pick::run_cherry_pick::cherry_pick
      run: ./script/cherry-pick "$BRANCH" "$COMMIT" "$CHANNEL"
      env:
        BRANCH: ${{ inputs.branch }}
        COMMIT: ${{ inputs.commit }}
        CHANNEL: ${{ inputs.channel }}
        GIT_COMMITTER_NAME: Zed Zippy
        GIT_COMMITTER_EMAIL: hi@zed.dev
        GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
defaults:
  run:
    shell: bash -euxo pipefail {0}
