Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mjorgegulab/mantis-bug-tracker-action
Mantis Bug Tracker Issue Creation Using Github Actions ✨📝
https://github.com/mjorgegulab/mantis-bug-tracker-action
action bug issue mantisbt tracker
Last synced: 3 months ago
JSON representation
Mantis Bug Tracker Issue Creation Using Github Actions ✨📝
- Host: GitHub
- URL: https://github.com/mjorgegulab/mantis-bug-tracker-action
- Owner: mjorgegulab
- License: mit
- Created: 2023-07-26T16:35:35.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-09-01T21:53:42.000Z (5 months ago)
- Last Synced: 2024-10-02T06:43:52.681Z (4 months ago)
- Topics: action, bug, issue, mantisbt, tracker
- Language: TypeScript
- Homepage:
- Size: 1.72 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Citation: CITATION.cff
Awesome Lists containing this project
README
Automate issue creation on Mantis Bug Tracker with this GitHub action. **It's free!**
## [![Test Code](https://github.com/mjorgegulab/mantis-bug-tracker-action/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/mjorgegulab/mantis-bug-tracker-action/actions/workflows/tests.yml) [![CodeQL](https://github.com/mjorgegulab/mantis-bug-tracker-action/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/mjorgegulab/mantis-bug-tracker-action/actions/workflows/github-code-scanning/codeql) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/e822fd93d7ee45d1856054062c86cbfc)](https://app.codacy.com/gh/mjorgegulab/mantis-bug-tracker-action/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade) [![Known Vulnerabilities](https://snyk.io/test/github/mjorgegulab/mantis-bug-tracker-action/badge.svg)](https://snyk.io/test/github/mjorgegulab/mantis-bug-tracker-action)
### Usage Example
Place the following in `/.github/workflows/mantisbt.yml`
```yml
on:
issues:
types: [opened]
name: 🚀 Open Mantis Bug Tracker Issue
jobs:
open-issue:
name: 🎉 Open MantisBT issue
runs-on: ubuntu-latest
steps:
- name: 📂 Open issue
uses: mjorgegulab/[email protected]
with:
base-url: 'https://bt.mantis.com'
url: '/mantis/api/rest/issues'
token: ${{ secrets.MANTIS_BT_API_KEY }}
summary: ${{ github.event.issue.title }}
description: ${{ github.event.issue.body }}
project-id: '11'
category-id: '4'
```### Setup Steps
1. Select the repository you want to add the action to
2. Select the `Actions` tab
3. Select `Blank workflow file` or `Set up a workflow yourself`, if you don't see these options manually create a yaml file `Your_Project/.github/workflows/mantisbt.yml`
4. Paste the example above into your yaml file and save
5. Now you need to add a key to the `secrets` section in your project. To add a `secret` go to the `Settings` tab in your project then select `Secrets`. Add a new `Secret` for `password`
6. Update your yaml file settings
7. If you appreciate this github action give it a :star: or show off with one of the [badges below](#badge).---
### Settings
Keys can be added directly to your .yml config file or referenced from your project `Secrets` storage.
To add a `secret` go to the `Settings` tab in your project then select `Secrets`.
I strongly recommend you store your `token` as a secret.#### _Action options_
| Key Name | Required | Example | Default Value | Description |
| ---------------- |----------|---------|---------------|-------------------------------------------|
| `skip-required` | No | `true` | `false` | Allow to skip the action required options |#### _HTTP client options_
| Key Name | Required | Example | Default Value | Description |
| ---------------- | -------- | ------------------------- | ------------- | -------------------------------------------- |
| `base-url` | Yes | `https://bt.mantis.com` | `null` | The base url of the MantisBT instance |
| `url` | Yes | `/mantis/api/rest/issues` | `/` | The url resource of the MantisBT API |
| `timeout` | No | `4000` | `5000` | The http request timeout (ms) |
| `proxy-type` | No | `https` | `null` | The proxy protocol to use: _HTTP_ or _HTTPS_ |
| `proxy-host` | No | `127.0.0.1` | `null` | The proxy ip/address to use |
| `proxy-port` | No | `8080` | `8080` | The proxy port to use |
| `proxy-username` | No | `root` | `null` | The proxy username |
| `proxy-password` | No | `toor` | `null` | The proxy password |#### _MantisBT issue information_
| Key Name | Required | Example | Default Value | Description |
|--------------------------|----------|------------------------------------| ------------- |-------------------------------------------------|
| `token` | Yes | `s7dgs8s6a8fa8d68sdgdgi` | `null` | The MantisBT API token |
| `summary` | Yes | `Super Issue Title ✨` | `null` | The MantisBT issue summary field |
| `pre-summary` | No | `SuperProject [FRONT] >` | `null` | Prepend a text before the summary |
| `description` | Yes | `Super Issue Description 📝` | `null` | The MantisBT issue description field |
| `additional-information` | No | `Some Tiny Additional Information` | `null` | The MantisBT issue additional information field |
| `project-id` | Yes | `11` | `null` | The MantisBT issue project id field |
| `category-id` | Yes | `4` | `null` | The MantisBT issue category id field |
| `handler-name` | No | `[email protected]` | `null` | The MantisBT issue handler name field |
| `view-state-name` | No | `private` | `null` | The MantisBT issue view state name field |
| `priority-name` | No | `normal` | `null` | The MantisBT issue priority name field |
| `severity-name` | No | `trivial` | `null` | The MantisBT issue severity name field |
| `reproducibility-name` | No | `always` | `null` | The MantisBT issue reproducibility name field |
| `tags` | No | `git log front api` | `null` | The MantisBT issue tags names field |> Check Mantis Bug Tracker API documentation on [This Link](https://documenter.getpostman.com/view/29959/mantis-bug-tracker-rest-api/7Lt6zkP)
### Outputs
This github action returns some variables once it has finished.
| Key Name | Example | Description |
| ----------- | ------------------------------------------------ | ---------------------- |
| `issue-id` | `00645` | The MantisBT issue id |
| `issue-url` | `https://bt.mantis.com/mantis/view.php?id=00645` | The MantisBT issue url |```yml
on:
issues:
types: [opened]
name: 🚀 Open Mantis Bug Tracker Issue
jobs:
open-issue:
name: 🎉 Open MantisBT issue
runs-on: ubuntu-latest
steps:
- name: 📂 Open issue
id: mantisbt
uses: mjorgegulab/[email protected]
with:
base-url: 'https://bt.mantis.com'
url: '/mantis/api/rest/issues'
token: ${{ secrets.MANTIS_BT_API_KEY }}
summary: ${{ github.event.issue.title }}
description: ${{ github.event.issue.body }}
project-id: '11'
category-id: '4'
- name: 🔤 Print output vars
run: echo "Issue ID ==> ${{ steps.mantisbt.outputs.issue-id }}" && \
echo "Issue URL ==> ${{ steps.mantisbt.outputs.issue-url }}"
```# Common Examples
#### Capture Github issue creation and publish it to MantisBT
```yml
name: Capture Github issue and open new mantis bug tracker issueon:
issues:
types: [opened]jobs:
main:
runs-on: ubuntu-latest
steps:
- name: MantisBT Issue
id: mantisbt
uses: mjorgegulab/[email protected]
with:
base-url: 'https://bt.mantis.com'
url: '/mantis/api/rest/issues'
token: ${{ secrets.MANTIS_BT_API_KEY }}
summary: ${{ github.event.issue.title }}
description: ${{ github.event.issue.body }}
project-id: '11'
category-id: '4'
```#### Capture Github issue, publish to mantis and update github issue
```yml
name: Open new mantis issue and update github issueon:
issues:
types: [opened]jobs:
main:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: MantisBT Issue
id: mantisbt
uses: mjorgegulab/[email protected]
with:
base-url: 'https://bt.mantis.com'
url: '/mantis/api/rest/issues'
token: ${{ secrets.MANTIS_BT_API_KEY }}
summary: ${{ github.event.issue.title }}
description: ${{ github.event.issue.body }}
project-id: '11'
category-id: '4'
- name: Add Mantis URL as Issue Comment
uses: peter-evans/create-or-update-comment@v3
with:
issue-number: ${{ github.event.issue.number }}
body: |
```#### Full example (all options) capturing Github issue, publish to mantis and update github issue
```yml
name: Open new mantis issue and update github issueon:
issues:
types: [opened]jobs:
main:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: MantisBT Issue
id: mantisbt
uses: mjorgegulab/[email protected]
with:
base-url: 'https://bt.mantis.com'
url: '/mantis/api/rest/issues'
token: ${{ secrets.MANTIS_BT_API_KEY }}
timeout: '5000'
proxy-type: 'https'
proxy-host: '127.0.0.1'
proxy-port: '8080'
proxy-username: 'root'
proxy-password: 'toor'
pre-summary: 'SuperProject-01 [FRONT] >'
summary: ${{ github.event.issue.title }}
description: ${{ github.event.issue.body }}
additional-information: 'Super additional info 🌟🌟🌟'
project-id: '11'
category-id: '4'
handler-name: '[email protected]'
view-state-name: 'public'
priority-name: 'normal'
severity-name: 'trivial'
reproducibility-name: 'never'
tags: |-
issue
github
super_tag
front
api
back- name: Add Mantis URL as Issue Comment
uses: peter-evans/create-or-update-comment@v3
with:
issue-number: ${{ github.event.issue.number }}
body: |
```---
_Want another example? Let me know by creating a [github issue](https://github.com/mjorgegulab/mantis-bug-tracker-action/issues/new)_
---
## Badge
If you appreciate this github action give it a :star: or show off with one of the badges below. Feel free to edit the text or color.
[](https://github.com/mjorgegulab/mantis-bug-tracker-action)
```md
[](https://github.com/mjorgegulab/mantis-bug-tracker-action)
```[](https://github.com/mjorgegulab/mantis-bug-tracker-action)
```md
[](https://github.com/mjorgegulab/mantis-bug-tracker-action)
```[](https://github.com/mjorgegulab/mantis-bug-tracker-action)
```md
[](https://github.com/mjorgegulab/mantis-bug-tracker-action)
```---
## Contributing to this project
PRs and Issues are welcome. 😘
## License
Copyright © thewolfx41 - Released under the MIT License.