create-commit-action

Create a commit using GitHub API in GitHub Actions

APACHE-2.0 License

Stars
2
Committers
3

create-commit-action ts

This is an action to push files using GitHub API.

Getting Started

To create a commit to a branch or tag:

jobs:
  build:
    steps:
      - uses: int128/create-commit-action@v1
        with:
          repository: ${{ github.repository }}
          ref: refs/heads/branch-name
          path: glob-pattern
          message: your-commit-message

If a branch or tag does not exist, this action creates it from default branch. Otherwise, this action updates it by fast-forward.

How it works

This action performs the following steps:

  1. Upload file(s) as blob
  2. Get the current commit and tree of a ref
  3. Create a tree
  4. Create a commit
  5. Create or update a ref

This action will retry from step 2 if the optimistic lock fails, that is,

  • The ref has been updated after step 2
  • The ref did not exist at step 2 but exists at step 5
Package Rankings
Top 23.98% on Github actions
Badges
Extracted from project README
ts