New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

commit-from-action

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

commit-from-action

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

latest
Source
npmnpm
Version
2.0.6
Version published
Maintainers
1
Created
Source

commit-from-action

License Sponsor commit-from-action
Build status Commits since v2.0.6 Last commit Issues
Latest version on npm Dependents Downloads

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

Installation

commit-from-action on npm

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

commit-from-action on Yarn

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

TypeDefaultInfo
autoApprovebooleantrueIf true, the created pull request will be automatically approved and merged.
autoRemoveBranchbooleantrueIf true, the created branch will be automatically deleted. Good for avoiding mess.
branchstringrandomly generatedName of the temporary branch. If this is explicitly set, option `branchPrefix` is ignored.
branchPrefixstring"action-"Starting string of the temporary branch's name. The rest of it will be randomly generated.
commitMessagestring"Modified repository in GitHub Action"Default commit message to use, if commitManager.commit() is called without an argument.
githubTokenInputNamestring"githubToken"The key of your action's input that passes the user's GitHub token.
ignoreFilesstring[][]List of globs of files not to commit.
mergeMessagestring"Automatically merged commits from pull {pullNumber}"Commit message of the pull request's merge.
pullRequestBodystring"Hewwo!"Description of the automatically created pull request.
pullRequestTitlestring"Automatic changes from GitHub Action"Title of the automatically created pull request.

Development

Development hints for maintaining and improving commit-from-action

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)

Keywords

action

FAQs

Package last updated on 12 Jun 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts