Skip to content

Instantly share code, notes, and snippets.

@mislav
Last active August 19, 2024 15:40
Show Gist options
  • Save mislav/b9fa0885660b4c10d41b039022fd2209 to your computer and use it in GitHub Desktop.
Save mislav/b9fa0885660b4c10d41b039022fd2209 to your computer and use it in GitHub Desktop.
Using GitHub CLI from GitHub Actions
name: Auto-merge
on:
pull_request:
types: [opened]
jobs:
automerge:
runs-on: ubuntu-latest
steps:
- name: Enable auto-merge for new PRs
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
name: Release
on:
push:
tags:
- "v*"
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build and upload
run: |
# First, build some files to `dist/*`. Then:
gh release create "${GITHUB_REF#refs/tags/}" dist/*.tgz dist/*.zip
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment