You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
GitHub Action
Add an issue link
v1.6.0
A GitHub Action for Linking a pull request to an issue.
This action add a comment or add texts into a body of Pull Request like this when it is opened.
# Related Issue
- Resolve #2
Create .github/workflows/issue-link.yml
.
name: 'Issue Links'
on:
pull_request:
types: [opened]
jobs:
issue-links:
runs-on: ubuntu-latest
steps:
- uses: tkt-actions/[email protected]
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}' # required
branch-prefix: 'issue-' # required
Need to contain the required parameters on the workflow file.
repo-token
- A token of the repository.
It can pass with{{ secrets.GITHUB_TOKEN }}
branch-prefix
- A prefix of a branch name for finding a related issue.
(Default: "issue-")position
- Changing position of link text section.
(allow "top" or "bottom". Default: "bottom")resolve
- Adding "resolve" prefix to close a related issue when the branch is merged.
(allow "true" or "false". Default: "false")repository
- Changing a base repository related to an issue.
If you use this option, "resolve" option become false.
(e.g.tkt-actions/issue-links
)link-style
-body
add an issue link by editing Pull Request body.
comment
add an issue link by creating comment to Pull Request.
(allow "body or "comment". Default: "body")
- Add an issue link to Pull Request body.
- Use branch prefix
/
. A branch name examplefeature/10/update
. - Set an issue repository.
name: 'Issue Links'
on:
pull_request:
types: [opened]
jobs:
issue-links:
runs-on: ubuntu-latest
steps:
- uses: tkt-actions/[email protected]
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
branch-prefix: '/'
repository: 'tkt-actions/add-issue-links'
- Add an issue link as a comment
- Resolve issue when a pull request is merged.
- Use branch prefix
issue-
. A branch name examplefeature/issue-10/update
.
name: 'Issue Links'
on:
pull_request:
types: [opened]
jobs:
issue-links:
runs-on: ubuntu-latest
steps:
- uses: tkt-actions/[email protected]
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}' # required
branch-prefix: 'issue-' # required
resolve: 'true' # optional (default: "false")
link-style: 'comment' # optional (default: "body")
Create a branch based on the pattern of the branch name ([branch prefix][issue number][you can put any texts]
) set up on .github/workflows/issue-reference.yml
.
For example, if branch-prefix
is issue-
, create a branch like issue-8/create-action
.
When pushing your changes to the repository and creating a pull request, a workflow runs automatically.
MIT