You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
GitHub Action
Get Linked Issues
v1.0
A utility that takes a PR and returns the issue object(s) returned by GH API that the PR is linked to. Github linking syntax.
This is desinged to be used with other actions that process the returned issues. Below is an example workflow YML that moves the project cards for issues linked to the PR into the 'Ready for Review' column when the PR is opened for review.
name: Sync Review Status
on:
# Requires the event trigger to be of type pull_request or pull_request_target
pull_request_target:
types: [review_requested]
jobs:
sync-review-status:
runs-on: ubuntu-latest
name: Get Linked Issues
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Get Linked Issues Action
uses: kin/[email protected]
id: linked-issues
with:
# Required: personal access token with permissions to archive cards
access-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Move Issues to Ready for Review Column
uses: kin/[email protected]
with:
access-token: "${{ secrets.GITHUB_TOKEN }}"
target-column: "Ready for Review"
issues: ${{ steps.linked-issues.outputs.issues }}
access-token
: Access token for repository. Use"{{ secrets.GITHUB_TOKEN }}"
to prevent leaking secrets.- It is important to note that this action requires that the workflow trigger event is of the
pull_request
orpull_request_target
type.
issues
: A stringified array of issue payloads with each issue payload formatted as{ issue: { <payload> } }
This will not find issues that are linked through the UI, nor will it find issues linked in repos outside of the one the PR is in. There is a planned fix for both of these issues.
To cotnribute, please open an Issue on the action repo: https://github.com/kin/gh-action-autoarchive-issues-for-column to discuss bugs/modifications.