ci: add migration to another tap #20
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: brew pr-pull | |
on: | |
pull_request_target: | |
types: | |
- labeled | |
env: | |
OVERRIDE_REPOSITORY: heartexlabs/tap | |
jobs: | |
pr-pull: | |
if: contains(github.event.pull_request.labels.*.name, 'pr-pull') | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Homebrew | |
uses: Homebrew/actions/setup-homebrew@master | |
- name: Set up git | |
uses: Homebrew/actions/git-user-config@master | |
- name: Pull bottles | |
env: | |
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.GIT_PAT }} | |
HOMEBREW_GITHUB_PACKAGES_TOKEN: ${{ secrets.GIT_PAT }} | |
HOMEBREW_GITHUB_PACKAGES_USER: ${{ github.actor }} | |
PULL_REQUEST: ${{ github.event.pull_request.number }} | |
HOMEBREW_NO_INSTALL_FROM_API: 1 | |
run: brew pr-pull --debug --tap=${{ env.OVERRIDE_REPOSITORY }} $PULL_REQUEST | |
# run: brew pr-pull --debug --tap=$GITHUB_REPOSITORY $PULL_REQUEST | |
- name: Push commits | |
uses: Homebrew/actions/git-try-push@master | |
with: | |
token: ${{ secrets.GIT_PAT }} | |
branch: master | |
- name: Delete branch | |
uses: actions/github-script@v6 | |
if: github.event.pull_request.head.repo.fork == false | |
with: | |
github-token: ${{ secrets.GIT_PAT }} | |
script: | | |
const { repo, owner } = context.repo; | |
await github.rest.git.deleteRef({ | |
owner, | |
repo, | |
ref: 'heads/${{ github.event.pull_request.head.ref }}', | |
}); | |
console.log(`Branch ${{ github.event.pull_request.head.ref }} is deleted`) |