linuxfoo-gitlab/README.md

30 lines
1.3 KiB
Markdown
Raw Normal View History

2021-11-27 03:40:05 +01:00
# linuxfoo-gitlab
## Summary
2021-11-27 11:28:39 +01:00
Embed a list of the most recent commits to a Gitlab project. Information is retrieved from a specified Gitlab instance's public REST API.
2021-11-27 03:40:05 +01:00
## Shortcode `gitlab-list-commits`
### Example
2021-11-27 11:28:39 +01:00
Add the following shortcode to your post for a list of at most 5 commits to that project that were made since at most 3 months ago:
```
[gitlab-list-commits url="https://tk-sls.de/gitlab" project_id=42 since="3 months" max=5]
```
2021-11-27 03:40:05 +01:00
### Attributes
* `url="STRING"`: Mandatory (example: `https://tk-sls.de/gitlab`).
2021-11-27 11:28:39 +01:00
* `project_id=NUM`: Mandatory; `NUM`: Positive Integer, valid project ID in Gitlab specified by `url` (example: `42`).
* `since="NUM UNIT"`: Optional; `NUM`: Positive integer; `UNIT`: `days`, `months`, `years`; exclude commits older than specified time interval (example: `3 months`).
* `max=NUM`: Optional; `NUM`: Positive integer; list not more than `NUM` commits (example: `5`).
* `ref_name=STRING`: List only commit from branch or reference name `STRING` (examples: `main`, `v1.1`).
2021-11-27 03:40:05 +01:00
* `default_branch`: If set, list only commits from the project's default branch.
## Author and License
* Copyleft 2021 Tilman Kranz <[t.kranz@tk-sls.de](mailto:t.kranz@tk-sls.de)>
* License: MIT License [https://opensource.org/licenses/MIT](https://opensource.org/licenses/MIT)