2.0.6 • Published 3 years ago

commit-from-action v2.0.6

Weekly downloads
6
License
-
Repository
github
Last release
3 years ago

commit-from-action



Utility class for making changes to a repository from a GitHub Action.

Installation

npm install --save commit-from-action@^2.0.6

yarn add commit-from-action@^2.0.6

Example

import CommitManager from "commit-from-action"
import {writeFile} from "fs/promises"

await writeFile("abc.txt", "abc")

const commitManager = new CommitManager
try {
  await commitManager.commit("Added file abc.txt")
  await commitManager.push()
} catch (error) {
  console.error(error)
} finally {
  // Does some cleaning, should be called regardless of whether commit and push are successful or not.
  await commitManager.finalize()
}

Options

Development

Setting up:

git clone git@github.com:jaid/commit-from-action.git
cd commit-from-action
npm install

License

MIT License
Copyright © 2021, Jaid \jaid.jsx@gmail.com (https://github.com/jaid)