Skip to content

Publish new CLI release to homebrew #89

Publish new CLI release to homebrew

Publish new CLI release to homebrew #89

name: "Create Pull Request and Enable Auto Merge"
on:
push:
branches:
- 'releases/**'
pull_request:
branches:
- 'master'
# Increase the access for the GH_TOKEN
permissions:
# This Allows the GITHUB_TOKEN to approve pull requests
pull-requests: write
# This Allows the GH_TOKEN to auto merge pull requests
contents: write
jobs:
create-pr-for-update:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' && github.actor == 'team-integrations-fnm-bot' }}
env:
GH_TOKEN: ${{secrets.INTEGRATIONS_FNM_BOT_TOKEN}}
steps:
- uses: actions/checkout@v3
- name: Create release update PR
run: gh pr create --title "Publish new CLI release to homebrew" --body "This is an automated PR, it should be auto-merged if checks are green."
pr-enable-auto-merge:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' && github.actor == 'team-integrations-fnm-bot' }}
env:
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
PR_URL: ${{github.event.pull_request.html_url}}
steps:
- uses: actions/checkout@v3
- name: Approve release update PR
run: gh pr review --approve "$PR_URL"
- name: Enable auto-merge for release update PR"
run: gh pr merge --auto --squash "$PR_URL"