Skip to content

Action to get information about a PR (also when the PR is merged to the main branch)

License

Notifications You must be signed in to change notification settings

strawberry-graphql/get-pr-info-action

Repository files navigation

Get PR info action

This GitHub action allows to get information about a PR. It also works when merging a PR into the main branch.

We use this action to send a tweet containing the PR's contributor name.

Inputs

This action requires no inputs. But it needs the GitHub access token to be able to get information about the PR and the contributor.

Outputs

  • has-pr: Wether this commit has a PR associated with it or not
  • pr-number: The PR number
  • contributor-name: The name of the contributor, it falls back to the contributor's username if the name is not set.
  • contributor-username: The username of the contributor.
  • contributor-twitter-username: The twitter username of the contributor.
  • repository-name : The name of the base repository

Example usage

name: Get PR info

on:
  pull_request:

jobs:
  get-contributor-info:
    name: Get PR info
    runs-on: ubuntu-latest

    outputs:
      contributor-name: ${{ steps.get-info.outputs.contributor-name }}
      contributor-username: ${{ steps.get-info.outputs.contributor-username }}
      contributor-twitter-username: ${{ steps.get-info.outputs.contributor-twitter-username }}

    steps:
      - uses: actions/checkout@v2
      - name: Get PR info
        id: get-info
        uses: strawberry-graphql/get-pr-info-action@v1
        env:
          ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}

About

Action to get information about a PR (also when the PR is merged to the main branch)

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •