devops-infra / action-pull-request

GitHub Action that will create a pull request from the current branch
https://christophshyper.github.io/
MIT License
74 stars 21 forks source link

bug: empty PR description #112

Closed anrico-oltmanns closed 1 year ago

anrico-oltmanns commented 1 year ago

:memo: Brief description

We merge everything to develop. Once a week we merge everything from develop to master. This weekly master merge contains 50+ commits from 10+ issues with 10+ pull requests. In our weekly master merge we want a description with all the related issues or related PRs. I tried different actions, tools or ways to do that. Now Im trying to use your action (which we already use for the weekly master merge). I tried using different actions where the output should be the related PRs and use this output in the body of your action. I tried using different outputs (url or PR number) of your action but nothing seems to work. Im pretty new to all of this but for my understanding im doing everything correctly. Once again, I tried a bunch of different things... The body is just always empty when I look into the logs. Is it a bug? Am I doing something wrong? Is it outdated? Here is a screenshot of my action:

Screenshot 2023-01-30 120654

This is a test repository with a PAT with most of the permissions. Im just trying to change the body. The comments are some things I tested before but they didnt work either.

:warning: Checklist

Check CONTRIBUTING.md and CODE_OF_CONDUCT.md for more information

ChristophShyper commented 1 year ago

Hello! Thank you for using my action.

Are you sure the previous action is setting the outputs properly? Maybe you can try to debug it in your vars step and just print it there.

I've run this:

      - name: Test
        id: test
        run: |
          outval="Test value\nSecond line\nThird line"
          echo "outval=$outval" >> $GITHUB_OUTPUT

      - name: Create pull request - test
        uses: devops-infra/action-pull-request@v0.5.3
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          body: ${{ steps.test.outputs.outval }}

And it created the PR properly image

anrico-oltmanns commented 1 year ago

Youre right. My output is just completly empty. I tried a bunch of different things and I guess the actions / workflows I used arent configured for my specific use-case. Because I used so many different actions / outputs and tried to put them in the description of the PR (which never worked) I thought it has to be something with your action. You probably dont have any suggestions how I could make it work? Thank you for your help anyways. This issue can be closed again.

ChristophShyper commented 1 year ago

I'm glad you found the source of your issue. Unfortunately, I don't have any full solution straight out of the bat for you. If you would use squash and merge for pull requests then diff between develop and master would just be the commits for pull requests. So this action would simply list it.