Skip to content
git-commit

GitHub Action

Fast Forward Bot

1.0.0 Latest version

Fast Forward Bot

git-commit

Fast Forward Bot

Merge pull request using fast forward only, if possible, moving base branch (target branch) to head branch (source branch)

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Fast Forward Bot

uses: APN-Pucky/fast-forward-action@1.0.0

Learn more about this action in APN-Pucky/fast-forward-action

Choose a version

fast-forward-action

Adds a fast-forward label to PRs and fast-forwards them on /fast-forward comment.

Use case

Github Web UI does not allow fast-forwarding of PRs:

https://stackoverflow.com/questions/60597400/how-to-do-a-fast-forward-merge-on-github

This disallows a linear commit history with a delayed stable branch.

Inputs

Input Description
GITHUB_TOKEN Automatically provided token, that can be used to authenticate on behalf of the GitHub action, with permissions limited to the repository that contains your workflow
SSH_PRIVATE_KEY Deploy key for push. Must be set in the repository settings. This is used by the action to push the fast-forwarded branch/commit/PR.

Workflow YML

The Action must be run on triggers to keep the labels up-to-date and run the fast-forward on command.

name: Fast-Forward

on: 
  issue_comment:
    types: [created]
  push:
  pull_request:

jobs:
  run:
    runs-on: ubuntu-latest
    steps:
      - uses: APN-Pucky/fast-forward-action@main
        with:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          SSH_PRIVATE_KEY: ${{ secrets.GH_SSH }}

Examples

For working examples checkout the fast-forward tagged PRs. They have been merged via the /fast-forward command.