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

Output the list of created PRs #161

Open
v1v opened this issue Sep 11, 2024 · 0 comments
Open

Output the list of created PRs #161

v1v opened this issue Sep 11, 2024 · 0 comments

Comments

@v1v
Copy link

v1v commented Sep 11, 2024

As a user I want to know the list of GitHub PRs that have been created so I can do something else with them afterwards.

name: Automatic backport action

on:
  pull_request_target:
    types: ["labeled", "closed"]

jobs:
  backport:
    name: Backport PR
    if: github.event.pull_request.merged == true && !(contains(github.event.pull_request.labels.*.name, 'backport'))
    runs-on: ubuntu-latest
    outputs:
      pull-requests: ${{ steps.backport.outputs.pull-requests }}
    steps:
      - name: Backport Action
        id: backport
        uses: sorenlouv/[email protected]
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          auto_backport_label_prefix: backport-to-
...

  auto-approve:
    needs: backport
    runs-on: ubuntu-latest
    permissions:
      pull-requests: write
    steps:
    - uses: hmarr/auto-approve-action@v4
      with:
        # a matrix job will help, but I hope I can explain the idea
        pull-request-number: ${{ needs.backport.outputs.pull-requests  }}

That can be handy if I post-process the created PRs with something else using ${{ secrets.GITHUB_TOKEN }}, such as: enable the auto-approval

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