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

how do i actually use this? #37

Open
simkimsia opened this issue Nov 15, 2021 · 4 comments
Open

how do i actually use this? #37

simkimsia opened this issue Nov 15, 2021 · 4 comments

Comments

@simkimsia
Copy link

i copied your existing workflow word for word

but nothing happened

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@v2
      # Basic use case example
      - name: Fast Forward PR
        id: ff-action
        uses:  ./
        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!'

as fast-forward.yml then i type /fast-forward in a pull request as comment. nothing happened

@simkimsia
Copy link
Author

Tried on a private repo. definitely does not work

What i use as fast-forward.yml this time

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: Fast Forward PR
        uses: endre-spotlab/[email protected]

image

@demisx
Copy link

demisx commented Dec 16, 2021

Worked for me. 🤷🏻‍♂️ Here is my fast-forward-pr.yml:

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.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!'
          staging_branch: 'main'
          production_branch: 'prod'

@mhostetter
Copy link

@demisx your action worked for me too. 😃

@vly-ginger
Copy link

vly-ginger commented Aug 3, 2022

My guess is that, if your uses is ./, then you need to have:

action.yml
dist/
  <all the .js files>

from this repo as well. Otherwise, there is no action, so it does nothing. Or worse, if you have your own ./action.yml that does something else, it will unintentionally be triggered.

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

4 participants