commit-from-action
v2.0.6
Published
Utility class for making changes to a repository from a GitHub Action.
Downloads
99
Maintainers
Readme
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 [email protected]:jaid/commit-from-action.git
cd commit-from-action
npm install
License
MIT License
Copyright © 2021, Jaid <[email protected]> (https://github.com/jaid)