# trigitactions

> Trigger git actions with cli

Latest version **1.0.3** (published 2020-11-28) · ISC license · 0 weekly downloads

## Install

```sh
npm install trigitactions
pnpm add trigitactions
yarn add trigitactions
bun add trigitactions
```

Provides the commands `trigit`, `listworflow`, `runworkflow`, `listworkflow`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2020-11-28 |
| First published | 2020-11-28 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 9.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Tchangang Boris-Emmanuel |
| Maintainers | hackstudio |
| Keywords | cli, create-project, github, actions, gitactions, trigger git action, manual gitaction, manual github action, github event, start git action |

## Links

- npm: https://www.npmjs.com/package/trigitactions
- Repository: https://github.com/Tchangang/trigitactions
- Homepage: https://github.com/Tchangang/trigitactions#readme
- Issues: https://github.com/Tchangang/trigitactions/issues
- npm.io page: https://npm.io/package/trigitactions

## Dependencies (6)

- [arg](https://npm.io/package/arg.md) ^5.0.0
- [esm](https://npm.io/package/esm.md) ^3.2.25
- [colors](https://npm.io/package/colors.md) ^1.4.0
- [inquirer](https://npm.io/package/inquirer.md) ^7.3.3
- [@octokit/core](https://npm.io/package/@octokit/core.md) ^3.2.1
- [@octokit/rest](https://npm.io/package/@octokit/rest.md) ^18.0.9

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 1.0.3 (latest) — 2020-11-28
- 1.0.2 — 2020-11-28
- 1.0.1 — 2020-11-28
- 1.0.0 — 2020-11-28

## README

#Trigitactions

⭐ Star us on GitHub — it helps!
Trigitactions is a cli to trigger github actions from terminal, npm / yarn script with just one line.

It uses @ocktokit under the hood and can be launched in 1 min.

## Installation

```javascript
npm i -g trigitactions
yarn global add trigitactions
```
One installed you have 3 commands:
- trigit: help menu for trigitactions cli
- runworkflow: Run a workflow on github actions
- listworflow: List for a given repository all worklow.id, worklow.name and worklow.filename

##Commands
###Auth
To interact with Github api, you need to setup an env variable with a github token value.
You can generate a token there: https://github.com/settings/tokens

###listworkflow
This command helps you to list all workflow in a repository.
````javascript
listworkflow -o Owner -r Repository -p Profile -q search_term
````
Owner and Repository are required.

Profile is not required, but you need to setup an env variable named TRIGIT_DEFAULT_PROFILE with a valid github token.
If your already have an env variable with a valid github token value, just use:
```javascript
-p YOUR_ENV_VARIABLE_NAME
```

If you are looking for a particular workflow, you can use the -q parameter. It's a simple filter as workflow.name.toLowerCase().includes(q).

Example
````javascript
listworkflow -o JohnDoe -r FirstCorp
----------------------------------------
Output:
Owner: JohnDoe | Repo: FirstCorp
Workflow found: 3
id: 1637264 | name: Build/company1 | filename: buildcompany1.yml
id: 6173621 | name: Build/company2 | filename: buildcompany2.yml
````

###runworkflow
This command helps you to trigger a github action.
````javascript
runworkflow  -o Owner -r Repository -w WorkflowId -i 'DataForJob:JSON' -f master
````
Owner and Repository are required.
This command uses the same config for -p variable as listworfklow command.

-w variable is the workflow id to trigger. You can use workflow.name or wrkflow.filename given in listworfklow command.

-i variable is for workflow input. To use this parameters, you need to define input in your .yml file, otherwise an error will be throw.
Data should be passed as a JSON string: ```-i '{"url": "http://example"}'```

-f is for ref. By default this will be set to master, you can use any branch or tag name.
 
 ````javascript
 runworkflow -o JohnDoe -r company1 -w 6176732 -i '{"dbUrl": "mydb.com"}' -f dev
 ----------------------------------------
 Output:
 Status: 204. Action triggered 👍
 ````

---
_Source: https://npm.io/package/trigitactions · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
