Skip to content

austenstone/list-prs-associated-with-a-commit

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 

Repository files navigation

Action

It's hard to get the PR associated with a merge because of rebase or squash.

This action uses the List pull requests associated with a commit API to get the PRs associated with a commit.

Usage

Create a workflow (eg: .github/workflows/usage.yml). See Creating a Workflow file.

Example

name: Usage
on:
  push:
  pull_request:
  workflow_dispatch:

jobs:
  run:
    name: Run Action
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - id: get-pr
        uses: austenstone/list-prs-associated-with-a-commit@main
      - run: echo '${{ fromJson(steps.get-pr.outputs.prs)[0].number }}'
      - run: echo '${{ fromJson(steps.get-pr.outputs.pr-numbers)[0] }}'

➡️ Inputs

Various inputs are defined in action.yml:

Name Description Default
github‑token Token to use to authorize. ${{ github.token }}
owner Owner of the repository. N/A
repo Name of the repository. N/A
sha The commit SHA. ${{ github.event.after 

⬅️ Outputs

Name Description
prs The PRs associated with the commit as JSON.
pr-numbers The PR numbers associated with the commit as JSON.

Further help

To get more help on the Actions see documentation.

About

Create a Composite Action

Resources

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published