Giter VIP home page Giter VIP logo

commit's Introduction

Commit and push changes back upstream. Lightweight action using only alpine and shell scripting.

Don't use v4 anymore as GitHub changed the way checkout works so it no longer works.

Usage

name: publish

on:
  push:
    branches:
    - master
    
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - name: checkout
      uses: actions/checkout@v2
    # make the changes between checkout and push
    - name: push
      uses: actions-x/commit@v5

All parameters are optional, with no parameters provided, these defaults are used:

  • name - the actor name, so if your github name is example the name will be example
  • email - the actor name @localhost, if your github name is example the email is example@localhost
  • message - Automatically updated using GitHub Actions
  • branch - defaults to the branch that triggered the action, so if you pushed to master, the branch is master
  • files - . (meaning all files in the whole tree)
  • repository - you can specify the repository to push the code to, default is origin (e.g. the same repository)
  • token - if you want to push to a different repository you need to provide your own token, otherwise you can leave it to the default value which is provided by GitHub Actions and works for the same repository
  • force - you can specify true to perform force push, default is to not use force push
  • directory - the working directory to do the commands in, default is . (current directory)

Full reference

name: publish

on:
  push:
    branches:
    - master
    
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - name: checkout
      uses: actions/checkout@v2
    # make the changes between checkout and push
    - name: push
      uses: actions-x/commit@v5
      with:
        email: [email protected]
        name: GitHub Actions Autocommitter
        branch: master
        files: file1 file2 directory directory2/file3
        repository: https://github.com/Example/SomeOtherRepository
        token: ${{ secrets.MY_SECRET_TOKEN }}
        force: true
        directory: path/to/different/repo

commit's People

Contributors

rikudousage avatar zengin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.