An open API service indexing awesome lists of open source software.

https://github.com/linuxsuren/gogit

Sending build status to different git providers
https://github.com/linuxsuren/gogit

Last synced: 10 months ago
JSON representation

Sending build status to different git providers

Awesome Lists containing this project

README

          

[![codecov](https://codecov.io/gh/LinuxSuRen/gogit/branch/master/graph/badge.svg?token=mnFyeD2IQ7)](https://codecov.io/gh/LinuxSuRen/gogit)

`gogit` could send the build status to different git providers. Such as:

* GitHub
* Gitlab (public or private)

## Usage

### Generate commit message with AI

```shell
export AI_PROVIDER=your-one-api-server-address
export ONEAPI_TOKEN=your-one-api-token

gogit commit
```

It supports [one-api](https://github.com/songquanpeng/one-api) only.

### Checkout to branch or PR
Ideally, `gogit` could checkout to your branch or PR in any kind of git repository.

You can run the following command in a git repository directory:

```shell
gogit checkout --pr 1
```

### Send status to Git Provider
Below is an example of sending build status to a private Gitlab server:

```shell
gogit status --provider gitlab \
--server http://10.121.218.82:6080 \
--repo yaml-readme \
--pr 1 \
--username linuxsuren \
--token h-zez9CWzyzykbLoS53s
```

Or in the following use cases:

* [Tekton Task](https://hub.tekton.dev/tekton/task/gogit)

### Send a notification to DingDing
Below is an example of sending a notification to DingDing based on the Gitlab/GitHub pull request author/reviewers/assignees:

```shell
gogit pr --provider gitlab \
--server http://10.121.218.82:6080 \
--repo yaml-readme \
--pr 1 \
--username linuxsuren \
--token h-zez9CWzyzykbLoS53s \
--msg 'workflow done' \
--dingding-tokens linuxsuren=dingdingtoken
```

## Argo workflow Executor
Install as an Argo workflow executor plugin:

```shell
cat <