Kev
Kev

Reputation: 286

Github actions pull request builder returns error

I have a github actions job which is failing on the last job. The build, unit test and regression test jobs are working fine but the pull-request job fails.

This is the code for the failing job, the token has been replaced.

  pull-request:
    needs: regression
    name: PullRequest
    runs-on: ubuntu-latest
    steps:
    - name: pullrequest
      uses: repo-sync/pull-request@v2  
      with:
        source_branch: development                      
        destination_branch: master       
        pr_label: automerge        
        github_token: ${{ secrets.ghp_secretscretsecretetcetc }}

And this is the message I get when the job fails enter image description here

enter image description here

Any ideas on what I am missing please?

Kev

Upvotes: 0

Views: 368

Answers (1)

GuiFalourd
GuiFalourd

Reputation: 22890

It seems that the problem is with the GITHUB_TOKEN you informed.

GitHub automatically creates a GITHUB_TOKEN secret to use in your workflow (you can find more information about it here).

Therefore in your case, you can follow the specifications informed on the action repository you're using:

pull-request:
    needs: regression
    name: PullRequest
    runs-on: ubuntu-latest
    steps:
    - name: pullrequest
      uses: repo-sync/pull-request@v2  
      with:
        source_branch: development                      
        destination_branch: master       
        pr_label: automerge        
        github_token: ${{ secrets.GITHUB_TOKEN }}

If you ever need a GITHUB_TOKEN with specific permissions, you can also create a Personal Access Token and add it as a secret to your repository.

In that case, you would overwrite the github_token: ${{ secrets.GITHUB_TOKEN }} by github_token: ${{ secrets.YOUR_SECRET_NAME }}.

Upvotes: 2

Related Questions