Skip to content

Latest commit

History

17 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

GitHub Action for GitHub Commit & Push

The GitHub Actions for commiting & pushing to GitHub repository local changes authorizing using GitHub token.

With ease:

  • update new code placed in the repository, e.g. by running a linter on it,
  • track changes in script results using Git as archive,
  • publish page using GitHub-Pages,
  • mirror changes to a separate repository.

Usage

Example Workflow file

An example workflow to authenticate with GitHub Platform:

jobs:
build:
runs-on: ubuntu-lateststeps:
- uses: actions/checkout@masterwith:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal tokenfetch-depth: 0# otherwise, you will fail to push refs to dest repo
- name: Create local changesrun: | ... - name: Commit & Push changesuses: actions-js/push@masterwith:
github_token: ${{ secrets.GITHUB_TOKEN }}

Inputs

namevaluedefaultdescription
github_tokenstringToken for the repo. Can be passed in using ${{ secrets.GITHUB_TOKEN }}.
author_emailstring'github-actions[bot]@users.noreply.github.com'Email used to configure user.email in git config.
author_namestring'github-actions[bot]'Name used to configure user.name in git config.
coauthor_emailstringEmail used to make a co-authored commit.
coauthor_namestringName used to make a co-authored commit.
messagestring'chore: autopublish ${date}'Commit message.
branchstring'main'Destination branch to push changes.
emptybooleanfalseAllow empty commit.
amendbooleanfalseDetermines if the commit should be amended. Needs to be used with force input to force push the amended commit.
forcebooleanfalseDetermines if force push is used.
tagsbooleanfalseDetermines if --tags is used.
rebasebooleanfalseDetermines if git pull --rebase is used before the push. This is useful if multiple actions try to push at the same time.
directorystring'.'Directory to change to before pushing.
repositorystring''Repository name. Default or empty repository name represents current github repository. If you want to push to other repository, you should make a personal access token and use it as the github_token input.

License

The Dockerfile and associated scripts and documentation in this project are released under the MIT License.

Credits

This is a slight modification of the ad-m/github-push-action action.

No affiliation with GitHub Inc.

GitHub are registered trademarks of GitHub, Inc. GitHub name used in this project are for identification purposes only. The project is not associated in any way with GitHub Inc. and is not an official solution of GitHub Inc. It was made available in order to facilitate the use of the site GitHub.

About

⬆️ Push changes made by actions right back into the current repository.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages