Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/script-0/from-github-issue-to-mongodb
https://github.com/script-0/from-github-issue-to-mongodb
Last synced: about 4 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/script-0/from-github-issue-to-mongodb
- Owner: script-0
- License: mit
- Created: 2022-10-14T13:15:34.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-03-01T04:59:32.000Z (over 1 year ago)
- Last Synced: 2024-10-18T09:35:24.676Z (about 1 month ago)
- Language: JavaScript
- Size: 1.01 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# From Github Issue To MongoDB
Use this action to convert issues into a unified JSON structure (thanks to [@stefanbuck](https://github.com/stefanbuck/github-issue-parser)) and save them in a MongoDB Collection.
## Setup
```yml
- uses: script-0/[email protected]
id: issue-to-mongodb
with:
template-path: .github/ISSUE_TEMPLATE/bug-report.yml # required
env:
MONGO_URI: ${{ secrets.SSUE_GITHUB_MONGO_URI }} # required
MONGO_DB: ${{ secrets.ISSUE_GITHUB_MONGO_DB }} # required
MONGO_COLLECTION: ${{ secrets.ISSUE_GITHUB_MONGO_COLLECTION }} # required
```The text to be parsed can be set explicitly using `issue-body` input, otherwise it can be left to use the default value of `${{ github.event.issue.body }}`.
## Example
Given an issue form
```yml
body:
- type: input
id: favorite_dish
attributes:
label: What's your favorite dish?
validations:
required: true- type: checkboxes
id: favorite_color
attributes:
label: What's your preferred color?
options:
- label: Red
- label: Green
- label: Blue
```And an issue body
```md
### What's your favorite dish?Pizza
### What's your preferred color?
- [x] Red
- [ ] Green
- [x] Blue
```The actions output will be
```json
{
"favorite_dish": "Pizza",
"favorite_color": ["Red", "Blue"]
}
```And this document will be saved in specified Mongo DB Collection.
## Action outputs
- `jsonString` - The entire output ,
- `issueparser_` - Access individual values## More on Github Issue parser ?
Want to learn more about this concept? Check out [@stefanbuck's repo](https://github.com/stefanbuck/github-issue-parser).