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

Unable to use your Action to add the reviewers #4

Open
phanim4u opened this issue Nov 7, 2022 · 1 comment
Open

Unable to use your Action to add the reviewers #4

phanim4u opened this issue Nov 7, 2022 · 1 comment

Comments

@phanim4u
Copy link

phanim4u commented Nov 7, 2022

Hi ,

I'm trying to use your action in my workflow for the below scenario. Workflow was able to create a PR and merge to Staging branch when there are no conflicts, but when there are conflicts it is running the whole workflow but unable to add the reviewer. so can you please help me where exactly i'm going wrong.

Note: when i create a PR manually from Master to Staging your action is working fine in the separate workflow but when i add to my workflow it is not adding the reviewer.

Scenario - I have three branches Master, Staging and testbranch... when i do some changes in testbranch and merge the PR to Master... a workflow need to be triggered and a PR need to be raised from Master to Staging branch and it should be merged if there are no conflicts.. and if there are conflicts then a reviewer need to be added.

@phanim4u
Copy link
Author

phanim4u commented Nov 7, 2022

Below is the workflow which i'm trying to run

name: "[chore] Merge pull request from Master to Staging"

on:
pull_request:
branches:
- Master
types: [closed]

permissions:
contents: write
pull-requests: write

jobs:
merge:
name: "[chore] Merge pull request from Master to Staging"
runs-on: ubuntu-latest
timeout-minutes: 8
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

  - name: Run auto-merge-action
    id: run-auto-merge-action
    uses: yyoshiki41/auto-merge-action@v1
    with:
      github-token: ${{ secrets.GITHUB_TOKEN }}
      base: Staging
      head: Master
      # testing changes"
  
  - name: get the PR 
    if: ${{ failure() }}
    uses: jwalton/gh-find-current-pr@v1
    id: findPr
    with:
      # Can be "open", "closed", or "all".  Defaults to "open".
      state: open
  - run: echo "Your PR is ${PR}"
    if: ${{ success() }} && steps.findPr.outputs.number
    env:
      PR: ${{ steps.findPr.outputs.pr }}
  
  # - name: Add Pull Request Reviewer
  #   if: ${{ failure() }}
  #   uses: AveryCameronUofR/[email protected]
  #   with: 
  #     reviewers: "robert-gagliardi_uhg"
  #     token: ${{ secrets.GITHUB_TOKEN }}
  # This will echo "Your PR is 7", or be skipped if there is no current PR.
  - name: Add Reviewers #check add reviewer
    if: ${{ failure() }}
    uses: madrapps/add-reviewers@v1 #check
    with:
      token: ${{ secrets.GITHUB_TOKEN }}
      reviewers: testUser #check
      re-request-when-approved: true
      re-request-when-changes-requested: true
      # add reviewer
      # test

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

1 participant