When your workflow triggers on a comment on PR (the issue_comment
-event), you can use this action to resolve the Git ref for that pull-request.
Required: Github API Token
Pull request base ref.
The SHA hash of the base ref.
Pull request head ref.
The SHA hash of the head ref.
- name: resolve pr refs
id: refs
uses: eficode/resolve-pr-refs@main
with:
token: ${{ secrets.GITHUB_TOKEN }}
on:
issue_comment:
types: [created]
jobs:
fast_forward_merge:
name: ff-merge
if: ${{ github.event.comment.body == '/ff-merge' }}
runs-on: ubuntu-latest
steps:
- name: resolve pr refs
id: refs
uses: eficode/resolve-pr-refs@main
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: checkout base
uses: actions/checkout@v2
with:
ref: ${{ steps.refs.outputs.base_ref }}
- name: fast forward merge pr
env:
HEAD_REF: ${{ steps.refs.outputs.head_ref }}
run: |
git fetch
git merge --ff-only origin/$HEAD_REF
git push
Create a PR against this repository. To test your changes, comment /test
on your PR.
npm i -g @vercel/ncc
ncc build index.js --license licenses.txt
git tag -a -m "Amazing new release" v1.1
git push --follow-tags