Skip to content

the action doesn't not return data on closed pr #165

@ghaniswara

Description

@ghaniswara

Subject of the issue

the action doesn't return api data on closed pr event

Your git environment

I have two github jobs one is to get the data using this repo action and one is a job that triggered when a pr is closed

jobs:
  get-pr:
    runs-on: ubuntu-latest
    outputs:
      PR: ${{steps.PR.outputs.pr}}
    steps:
      - name: Find Pull Request
        uses: 8BitJonny/[email protected]
        id: PR
        with:
          sha: ${{ github.event.pull_request.head.sha }}

closed_by_user:
    timeout-minutes: 30
    needs: get-pr
    if:  needs.get-pr.outputs.PR != '' && github.event.pull_request.merged == false && github.event.pull_request.closed
    runs-on: ubuntu-latest
    steps: 
         .....

Steps to reproduce

with the following if condition on the job

needs.get-pr.outputs.PR != '' && github.event.pull_request.merged == false && github.event.pull_request.closed

Expected behaviour

needs.get-pr.outputs.PR return json data , the job will triggered

Actual behaviour

the closed_by_user jobs didn't run because the needs.get-pr.outputs.PR didn't return any json data

when I removed the needs.get-pr.outputs.PR != '' the job is triggered, but got error since I need a data from the API, but the data is empty

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions