https://github.com/ldez/gha-mjolnir
:hammer: GitHub Action to close issues related to the merge of a pull request.
https://github.com/ldez/gha-mjolnir
close github-action issues pull-requests
Last synced: about 1 year ago
JSON representation
:hammer: GitHub Action to close issues related to the merge of a pull request.
- Host: GitHub
- URL: https://github.com/ldez/gha-mjolnir
- Owner: ldez
- License: other
- Created: 2019-02-18T02:28:00.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2025-01-06T19:28:08.000Z (over 1 year ago)
- Last Synced: 2025-04-09T23:16:54.495Z (about 1 year ago)
- Topics: close, github-action, issues, pull-requests
- Language: Go
- Homepage:
- Size: 57.6 KB
- Stars: 43
- Watchers: 2
- Forks: 8
- Open Issues: 2
-
Metadata Files:
- Readme: readme.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Mjolnir
[](https://github.com/ldez/gha-mjolnir/releases)
[](https://github.com/ldez/gha-mjolnir/actions)
[](https://hub.docker.com/r/ldez/gha-mjolnir/)
[](https://github.com/sponsors/ldez)
Close issues related to the merge of a pull request.
Useful:
- to close multiple issues related to a pull request.
- to close issues related to a pull request not based on the default branch (ex: `master`, `main`).
For example, when a branch is related to version (e.g. `v1.5`, `v2.0`, ...)
- To add the same milestone defined on the PR to closed issues.
## Supported Syntax
- prefixes (case insensitive): `close`, `closes`, `closed`, `fix`, `fixes`, `fixed`, `resolve`, `resolves`, `resolved`
- issues references separators (can be mixed): ` ` (space), `,` (period)
- prefix and issues references can be separated by: ` ` (space), `:` (colon), or both.
Examples:
```
Fixes #1,#2,#3
close #1, #2, #3
fix #1 #2 #3
resolve #1,#2 #3
Resolves: #1,#2,#3
closed : #1, #2, #3
```
## Usage
```yaml
name: Close issues related to a merged pull request based on master branch.
on:
pull_request:
types: [closed]
branches:
- master
jobs:
closeIssueOnPrMergeTrigger:
runs-on: ubuntu-latest
steps:
- name: Closes issues related to a merged pull request.
uses: ldez/gha-mjolnir@v1.4.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```