@tunnckocore/circleci
v0.2.4
Published
Small and simple CircleCI client library to requesting the API and authorization via token
Downloads
20
Readme
@tunnckocore/circleci
Small and simple CircleCI client library to requesting the API and authorization via token
Please consider following this project's author, Charlike Mike Reagent, and :star: the project to show your :heart: and support.
If you have any how-to kind of questions, please read the Contributing Guide and Code of Conduct documents.
For bugs reports and feature requests, please create an issue or ping
@tunnckoCore at Twitter.
Project is semantically & automatically released on CircleCI with new-release and its New Release GitHub App.
Table of Contents
(TOC generated by verb using markdown-toc)
Install
This project requires Node.js ^8.11.0 || >=10.13.0. Install it using
yarn or npm.
We highly recommend to use Yarn when you think to contribute to this project.
$ yarn add @tunnckocore/circleci
API
Generated using docks.
src/index.js
circleci
Currently only supports POST
request to the API, so endpoints
such as /follow
and /build
are working, but not /me
because
it needs a GET
request. Basically what this module is doing
by default is that you pass a options.repository
and options.token
,
and it "follows" (e.g. enables) a CircleCI service on that repository.
The token also can be passed as options.circleci_token
or as
an environment variable process.env.CIRCLE_CI
.
If you want to trigger a build, instead of enabling a project,
then pass second parameter 'build'
.
Params
[options]
{object} optional, passoptions.repository
andoptions.token
[type]
{string} type of action, by default'follow'
Returns
Promise<object>
response from the api, requested with axios
Examples
import circleci from '@tunnckocore/circleci';
async function main() {
const options = { repository: 'tunnckoCoreLabs/foobar', token: 'XXX' };
const resultOfFollow = await circleci(options);
console.log(resultOfFollow);
const triggeredBuild = await circleci(options, 'build');
console.log(triggeredBuild)
}
main().catch(console.error);
See Also
Some of these projects are used here or were inspiration for this one, others are just related. So, thanks for your existance!
- @tunnckocore/config: All the configs for all the tools, in one place | homepage
- @tunnckocore/create-project: Create and scaffold a new project, its GitHub repository and… more | homepage
- @tunnckocore/execa: Thin layer on top of execa that allows executing multiple… more | homepage
- @tunnckocore/scripts: Universal and minimalist scripts & tasks runner. | homepage
- @tunnckocore/update: Update a repository with latest templates from
charlike
. | homepage - asia: Blazingly fast, magical and minimalist testing framework, for Today and… more | homepage
- charlike: Small & fast project scaffolder with sane defaults. Supports hundreds… more | homepage
- docks: Extensible system for parsing and generating documentation. It just freaking… more | homepage
- gitcommit: Lightweight and joyful
git commit
replacement. Conventional Commits compliant. | homepage
Contributing
Follow the Guidelines
Please read the Contributing Guide and Code of Conduct documents for advices.
For bugs reports and feature requests, please create an issue or ping
@tunnckoCore at Twitter.
Support the project
Become a Partner or Sponsor? :dollar: Check the Partner, Sponsor or Omega-level tiers! :tada: You can get your company logo, link & name on this file. It's also rendered on package page in npmjs.com and yarnpkg.com sites too! :rocket:
Not financial support? Okey! Pull requests, stars and all kind of contributions are always welcome. :sparkles:
OPEN Open Source
This project is following OPEN Open Source model
Individuals making significant and valuable contributions are given commit-access to the project to contribute as they see fit. This project is built on collective efforts and it's not strongly guarded by its founders.
There are a few basic ground-rules for its contributors
- Any significant modifications must be subject to a pull request to get feedback from other contributors.
- Pull requests to get feedback are encouraged for any other trivial contributions, but are not required.
- Contributors should attempt to adhere to the prevailing code-style and development workflow.
Wonderful Contributors
Thanks to the hard work of these wonderful people this project is alive! It follows the
all-contributors specification.
Don't hesitate to add yourself to that list if you have made any contribution! ;) See how,
here.
| Charlike Mike Reagent💻 📖 💬 👀 🔍 | | :---: |
Consider showing your support to them. :sparkling_heart:
License
Copyright (c) 2018-present, Charlike Mike Reagent <[email protected]>
& contributors.
Released under the Apache-2.0 License.