question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using the following workflow:

on:
  pull_request:
    branches:
      - main
    types:
      - closed

name: Tag on merged PR

jobs:
  tag:
    name: Tag merged MR
    if: github.event.pull_request.merged == true
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v1
      - name: Get PR description
        uses: jwalton/gh-find-current-pr@v1
        id: findPr
      - name: Echo PR data
        run: echo "Number = ${number} | Title = ${title} | Body = ${body}"
        env:
          number: ${{ steps.findPr.outputs.pr }}
          title: ${{ steps.findPr.outputs.title }}
          body: ${{ steps.findPr.outputs.body }}

The steps.findPr.outputs.* fields return empty.

If I modify the workflow to use the example given in this repository readme, the step does not run, as if it was not triggered by a merged PR. I’m working on a Private repository (for testing purposes), maybe this is not possible with this Action? I tried using the GITHUB_TOKEN, as I saw on the Action source that it was an optional parameter.

on:
  push:
    branches:
      - main

name: Tag on merged PR

jobs:
  tag:
    name: Tag merged MR
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v1
      # Find the PR associated with this push, if there is one.
      - uses: jwalton/gh-find-current-pr@v1
        id: findPr
        env:  # tried with "env" and "with"
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      # This will echo "Your PR is 7", or be skipped if there is no current PR.
      - run: echo "Your PR is ${PR}"
        if: success() && steps.findPr.outputs.number
        env:
          PR: ${{ steps.findPr.outputs.pr }}

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
jwaltoncommented, Aug 12, 2021

Ah, yes it won’t find a merged PR. I can add an option to allow closed PRs.

On Aug 12, 2021, at 12:25, dudicoco @.***> wrote:

@jwalton thanks

I believe the problem might be that you are looking only for open PRs, while PRs that were merged are considered closed.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

1reaction
jwaltoncommented, Aug 19, 2021

Released as v1.2.0.

Read more comments on GitHub >

github_iconTop Results From Across the Web

138 Synonyms & Antonyms for NOT WORKING - Thesaurus.com
synonyms for not working · baseless · false · inoperative · irrational · null · unreasonable · unscientific · unsound ...
Read more >
Working Not Working
Trusted by over 2000 of the world's most innovative companies to staff their creative projects.
Read more >
Not Working: Cohen, Josh - Amazon.com
Not Working is a laudable attempt to address an important aspect of our lives. However, the book's many digressions into biography, literary and...
Read more >
Not Working: Where Have All the Good Jobs Gone?
Not Working is about those who can't find full-time work at a decent wage—the underemployed—and how their plight is contributing to widespread ...
Read more >
Not Working by Lisa Owens - Goodreads
Not Working book. Read 658 reviews from the world's largest community for readers. Claire Flannery has just quit her office job, hoping to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found