https://github.com/ynput/github-query
fetch and convert certain information retrieved from github
https://github.com/ynput/github-query
Last synced: about 2 months ago
JSON representation
fetch and convert certain information retrieved from github
- Host: GitHub
- URL: https://github.com/ynput/github-query
- Owner: ynput
- Created: 2024-08-20T14:25:17.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-12-12T08:35:16.000Z (over 1 year ago)
- Last Synced: 2026-04-13T07:49:49.231Z (about 2 months ago)
- Language: Python
- Size: 98.6 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Github-Query
[](https://github.com/ynput/github-query/actions/workflows/action-ci.yml)
**This is a customized query action for Ayon-related repo-workflows.**
## Purpose
This action mainly queries pull request related information.
It got a bunch of conversion going on to prepare the data for further usage. This includes
* Filtering PR labels
* Suggest version increment based on found labels
* Preparing data structure for release information
* Prepare a markdown formatted changelog based on PR information
## Usage
For details see [action.yml](https://github.com/ynput/github-query/blob/main/action.yml) file
```yaml
- name: Query PR data
uses: ynput/github-query@main
with:
# Repository name with owner. For example, actions/checkout
repo: ""
# Date-Time-Stamp as a starting point for the query, will only process merged PRs newer then that date
# format: "2024-08-20T12:03:23Z"
date: ""
# JSON keys to query for in a gh query command
# gh pr list --state merged --search f'merged:>=' --json "body,labels,title,id,number,url" --repo
query_parameters: ""
# Define change log content and order by this comma separated value string
# example: "enhancement,bugfix,docs"
changelog_labels: ""
```
## Outputs
* raw-output - Full output json dictionary from github api
* label-list - List of unique labels found in PRs
* bump-increment - Increment for version bumping - either 'patch', 'minor' or 'major'
* changelog-markdown - String containing markdown formatted release changelog
## Testing
Unit-test are included in `tests/` and will run on every pr targeting main and very push to main.
These tests can be run local by changing into the `tests/` directory and running `pytest`
## Developer-Docs
The python file `github_query.py` calls all the main logic and provides it's function to `action.yml` through click-parameters.
This makes the python function calls convenient to use from terminal while keeping them easy to test. For more detailed documentation check the [docs directory](https://github.com/ynput/github-query/tree/main/docs).