0

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 the devops-infra action-pull-request (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 this action but nothing seems to work. 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 my action:

name: weekly master merge

on:  
  workflow_dispatch:
  
jobs:
  createPullRequest:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0

      - name: Release Changelog Builder
        uses: buildsville/list-pull-requests@v1
        id: list
        with:
          token: ${{ secrets.ALL }}
          Labels: '["app/admin"]'
          skip_hour: '24'
          
      - name: Set output variables
        id: vars
        run: |
          pr_title="Releases week #$(date +%W)"
          body=${{ steps.list.outputs.pulls }}
          echo "pr_title=$pr_title" >> $GITHUB_OUTPUT
          echo "body=$body >> $GITHUB_OUTPUT
          
      - name: Create Pull Request
        uses: devops-infra/action-pull-request@v0.5.3
        id: test
        with:
          github_token: ${{ secrets.ALL }}
          source_branch: test
          target_branch: main
          title: ${{ steps.vars.outputs.pr_title }}
          #body: ${{ steps.list.outputs.pulls }}
          body: ${{ steps.vars.outputs.outval }} 
          #body: ${{ steps.test.outputs.* }}
          #body: ${{ steps.test.outputs.url }}

It doesnt matter what I do, the PR from this action always has a body full of commits (default body of this action).

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.

Im pretty new to all of this but for my understanding im doing everything correctly. Once again, I tried a bunch of different things...

  • Did you try to verify by printing those output values in an intermediate step before passing them on to that action? Also, please add your workflow to your question as text, not image. Thanks! – Azeem Jan 30 '23 at 13:43
  • I just printed out the outputs and values of the body. Its completly empty. It is not about the body itself though, its the other action I use to get the associated PRs. Is there maybe a way to use the REST API to get associated PRs? For example by checking the commits? Our commit titles are: `title#` @Azeem – Anrico Oltmanns Feb 01 '23 at 07:41
  • Right. You observe that there is no output from the previous step (from that action), right? I'm not sure if there exists such a REST API. – Azeem Feb 01 '23 at 09:59
  • Yeo. There are no outputs from the previous step. It is because these actions Im trying to use are configured to do something else. It is not made for my use-case. But I cant find anything or have a clue how to achieve what im trying to achieve. – Anrico Oltmanns Feb 01 '23 at 10:12
  • Yes, your use case seems to be like traversing the description and extracting issues and PR numbers. There must be some predefined format to look for to extract this. – Azeem Feb 01 '23 at 10:17

0 Answers0