Giter Club home page Giter Club logo

Comments (14)

spaze avatar spaze commented on August 18, 2024 4

I've worked around the issue by letting my GitHub Actions test workflow run also on pull request review events:

on: [push, pull_request_review]

Running /rebase will rebase the branch but the PR will be stuck waiting for the test workflow to finish but it doesn't even start (that's this issue). Approving a review will start it and run it again and then the test workflow finishes 🎉
GitHub can also optionally dismiss an existing review automatically prompting someone to approve the change again triggering the test workflow.

Not perfect but it works for me. Thank you for this rebase action 👍

from rebase.

walterholohan avatar walterholohan commented on August 18, 2024 1

Thank you, It was an issue on my end. I was trying to test this out in a PR but when I triggered a rebase by adding a /rebase comment it what using the workflow from the develop branch instead of the PR. Once I merged the PR it worked. I also added persist-credentials: false to the checkout action

from rebase.

sebastianvarela avatar sebastianvarela commented on August 18, 2024

+1
I tryied to pass a custom token, but nothing changed... my test workflows don't fire.

    - name: Automatic Rebase
      uses: cirrus-actions/[email protected]
      env:
        GITHUB_TOKEN: ${{ secrets.MY_GITHUB_API_TOKEN }}  

from rebase.

gurrpi avatar gurrpi commented on August 18, 2024

+1

from rebase.

fkorotkov avatar fkorotkov commented on August 18, 2024

This is a weird Actions limitation that one workflow can't trigger another one. See this community post for more details. I don't believe there is a viable workaround at the moment. On a bright side it does work with 3rdparty CIs like Travis, Circle and Cirrus.

from rebase.

starsep avatar starsep commented on August 18, 2024

I tried adding

on:
  workflow_run:
    workflows: ["Automatic Rebase"]
    types: 
      - completed

to test workflow, it is run on default branch not within context of rebased pull request.

Documentation seemed promising

This event occurs when a workflow run is requested or completed, and allows you to execute a workflow based on the finished result of another workflow. For example, if your pull_request workflow generates build artifacts, you can create a new workflow that uses workflow_run to analyze the results and add a comment to the original pull request.

https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#workflow_run

But article about this feature clearly states that

Runs triggered by the workflow_run event always use the default branch for the repository

https://github.blog/2020-08-03-github-actions-improvements-for-fork-and-pull-request-workflows/

from rebase.

jolestar avatar jolestar commented on August 18, 2024

This is a weird Actions limitation that one workflow can't trigger another one. See this community post for more details. I don't believe there is a viable workaround at the moment. On a bright side it does work with 3rdparty CIs like Travis, Circle and Cirrus.

this action https://github.com/Label305/AutoRebase can auto rebase and trigger CI workflow by use a personal github token.

I try to use a personal github token for cirrus-actions/rebase, but not work.

from rebase.

spaze avatar spaze commented on August 18, 2024

I've now created a PR with that workaround description because maybe more people might find it useful.

from rebase.

walterholohan avatar walterholohan commented on August 18, 2024

Do you think this will be fixed anytime soon by the GHA team?

from rebase.

jackton1 avatar jackton1 commented on August 18, 2024

@walterholohan Fixed here #70

from rebase.

walterholohan avatar walterholohan commented on August 18, 2024

@jackton1 I updated the action yaml file to

on:
  issue_comment:
    types: [created]
name: Automatic Rebase
jobs:
  rebase:
    name: Rebase
    if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/rebase')
    runs-on: ubuntu-latest
    steps:
    - name: Checkout the latest code
      uses: actions/checkout@v2
      with:
        fetch-depth: 0 # otherwise, you will fail to push refs to dest repo,
        persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token.
    - name: Automatic Rebase
      uses: cirrus-actions/[email protected]
      env:
        GITHUB_TOKEN: ${{ secrets.GH_PAT }}

where secrets.GH_PAT is a PAT that I have setup. However this did not solve the issue. After a successful rebase by thecirrus-actions/[email protected] action it did not trigger a new check workflow. Am I missing something from the above snippet?

from rebase.

jackton1 avatar jackton1 commented on August 18, 2024

@walterholohan it seems actions/checkout@v2 fails with the default github.token

Update

name: Automatic Rebase
on:
  issue_comment:
    types: [created]
jobs:
  rebase:
    name: Rebase
    if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/rebase')
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          token: ${{ secrets.PAT_TOKEN }}
          fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
      - name: Automatic Rebase
        uses: cirrus-actions/[email protected]
        env:
          GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}

from rebase.

walterholohan avatar walterholohan commented on August 18, 2024

@jackton1 ive changed to the above suggestion but still no luck. The rebase completed successfully but the actions did not get triggered. Does the PAT need certain permissions? Maybe its missing something.

from rebase.

jackton1 avatar jackton1 commented on August 18, 2024

@walterholohan Try again using
Screen Shot 2021-01-11 at 7 49 19 PM

Note for workflows that modify github actions you can enable

Screen Shot 2021-01-11 at 7 50 39 PM

from rebase.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.