Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does anyone have an updated working example of how to use this action? #46

Open
coreybruyere opened this issue Aug 9, 2023 · 1 comment

Comments

@coreybruyere
Copy link

coreybruyere commented Aug 9, 2023

I've followed a few examples provided from users in a few different issues and haven't had any luck. I've created a repository secret in lieu of the automatically applied GITHUB_SECRET mentioned in the docs.

Here's what I have in my repo, stored in a ff-merge.yml file under the following directory structure: [REPO]/.github/workflows/ff-merge.yml

With this installed in my repo, I'm still unable to get FF merges working via Github UI when commenting /fast-forward. Going to utilize CLI merges as a workaround for now....

name: Fast-Forward PR

on: 
  issue_comment:
    types: [created]

jobs:
  fast_forward_job:
    name: Fast Forward
    if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/fast-forward')   
    runs-on: ubuntu-latest
    steps:
      # To use this repository's private action, you must check out the repository
      - name: Checkout code into workspace directory
        uses: actions/checkout@v2
        with:
          fetch-depth: 0
      # Basic use case example
      - name: Fast Forward PR
        id: ff-action
        uses: endre-spotlab/fast-forward-js-action@master
        with:
          GITHUB_TOKEN: ${{ secrets.ACTION_SECRET }}
          success_message: 'Success! Fast forwarded ***target_base*** to ***source_head***! ```git checkout target_base && git merge source_head --ff-only``` '
          failure_message: 'Failed! Cannot do fast forward!'
          staging_branch: 'stage'
          production_branch: 'main'
@doglaza
Copy link

doglaza commented Apr 8, 2024

`on:
issue_comment:
types: [created]

jobs:
fast_forward_job:
name: Fast Forward
# if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/fast-forward')
runs-on: ubuntu-latest
steps:
# To use this repository's private action, you must check out the repository
- name: Checkout
uses: actions/checkout@v4
# Basic use case example
- name: Fast Forward PR
id: ff-action
uses: endre-spotlab/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
success_message: 'Success! Fast forwarded target_base to source_head! git checkout target_base && git merge source_head --ff-only '
failure_message: 'Failed! Cannot do fast forward!'
production_branch: 'master'
staging_branch: 'staging'`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants