All Projects → EndBug → Add And Commit

EndBug / Add And Commit

Licence: mit
Add & commit files from a path directly from GitHub Actions

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Add And Commit

Apple Automation
iOS/macOS 自动化,效率玩法探索。
Stars: ✭ 60 (-69.7%)
Mutual labels:  automation, workflow
Auto.js
A UiAutomator on android, does not need root access(安卓平台上的JavaScript自动化工具)
Stars: ✭ 10,882 (+5395.96%)
Mutual labels:  automation, workflow
Automation
code generator
Stars: ✭ 65 (-67.17%)
Mutual labels:  automation, workflow
Commitlint
📓 Lint commit messages
Stars: ✭ 9,847 (+4873.23%)
Mutual labels:  lint, commit
Git Commit Style Guide
Make git commit message more readable and useful.
Stars: ✭ 170 (-14.14%)
Mutual labels:  workflow, commit
Xible
Visualize your workflow
Stars: ✭ 49 (-75.25%)
Mutual labels:  automation, workflow
Aws Workflows On Github
Workflows for automation of AWS services setup from Github CI/CD
Stars: ✭ 95 (-52.02%)
Mutual labels:  automation, workflow
Prefect
The easiest way to automate your data
Stars: ✭ 7,956 (+3918.18%)
Mutual labels:  automation, workflow
Openflow
Scalable, secure workflow solution
Stars: ✭ 122 (-38.38%)
Mutual labels:  automation, workflow
Pipedream
Connect APIs, remarkably fast. Free for developers.
Stars: ✭ 2,068 (+944.44%)
Mutual labels:  automation, workflow
Sooty
The SOC Analysts all-in-one CLI tool to automate and speed up workflow.
Stars: ✭ 867 (+337.88%)
Mutual labels:  automation, workflow
N8n
Free and open fair-code licensed node based Workflow Automation Tool. Easily automate tasks across different services.
Stars: ✭ 19,252 (+9623.23%)
Mutual labels:  automation, workflow
Walkoff
A flexible, easy to use, automation framework allowing users to integrate their capabilities and devices to cut through the repetitive, tedious tasks slowing them down. #nsacyber
Stars: ✭ 855 (+331.82%)
Mutual labels:  automation, workflow
Bpmn Elements
Executable workflow elements based on BPMN 2.0
Stars: ✭ 54 (-72.73%)
Mutual labels:  automation, workflow
Feflow
🚀 A command line tool aims to improve front-end engineer workflow and standard, powered by TypeScript.
Stars: ✭ 942 (+375.76%)
Mutual labels:  lint, workflow
Server
The Prefect API and backend
Stars: ✭ 87 (-56.06%)
Mutual labels:  automation, workflow
Beehive
A flexible event/agent & automation system with lots of bees 🐝
Stars: ✭ 5,348 (+2601.01%)
Mutual labels:  automation, workflow
Openrpa
Free Open Source Enterprise Grade RPA
Stars: ✭ 596 (+201.01%)
Mutual labels:  automation, workflow
Action Download Artifact
⚙️ A GitHub Action to download an artifact associated with given workflow and commit or other criteria
Stars: ✭ 107 (-45.96%)
Mutual labels:  workflow, commit
Endly
End to end functional test and automation framework
Stars: ✭ 178 (-10.1%)
Mutual labels:  automation, workflow

Add & Commit

Public workflows that use this action. All Contributors

You can use this GitHub Action to commit changes made in your workflow run directly to your repo: for example, you use it to lint your code, update documentation, commit updated builds, etc....

This is heavily inspired by git-auto-commit-action (by Stefan Zweifel): that action automatically detects changed files and commits them. While this is useful for most situations, this doesn't commit untracked files and can sometimes commit unintended changes (such as package-lock.json or similar, that may have happened during previous steps).
This action lets you choose the path that you want to use when adding & committing changes so that it works as you would normally do using git on your machine.

Usage

Add a step like this to your workflow:

- uses: EndBug/[email protected] # You can change this to use a specific version
  with:
    # The arguments for the `git add` command (see the paragraph below for more info)
    # Default: '.'
    add: 'src'

    # The name of the user that will be displayed as the author of the commit
    # Default: author of the commit that triggered the run
    author_name: Your Name

    # The email of the user that will be displayed as the author of the commit
    # Default: author of the commit that triggered the run
    author_email: [email protected]

    # Name of the branch to use, if different from the one that triggered the workflow
    # Default: the branch that triggered the run
    branch: some-branch

    # The local path to the directory where your repository is located. You should use actions/checkout first to set it up
    # Default: '.'
    cwd: './path/to/the/repo'

    # The message for the commit
    # Default: 'Commit from GitHub Actions (name of the workflow)'
    message: 'Your commit message'

    # The flag used on the pull strategy. Use NO-PULL to avoid the action pulling at all.
    # Default: '--no-rebase'
    pull_strategy: 'NO-PULL or --no-rebase or --no-ff or --rebase'

    # Whether to push the commit and, if any, its tags to the repo. It can also be used to set the git push arguments (see the paragraph below for more info)
    # Default: true
    push: false

    # The arguments for the `git rm` command (see the paragraph below for more info)
    # Default: ''
    remove: './dir/old_file.js'

    # Whether to use the --signoff option on `git commit` (only `true` and `false` are accepted)
    # Default: false
    signoff: true

    # Arguments for the git tag command (the tag name always needs to be the first word not preceded by an hyphen)
    # Default: ''
    tag: 'v1.0.0 --force'

Adding files:

The action adds files using a regular git add command, so you can put every kind of argument in the add option. For example, if you want to force-add a file: ./path/to/file.txt --force.
The script will not stop if one of the git commands fails. E.g.: if your command shows a "fatal: pathspec 'yourFile' did not match any files" error the action will go on.
You can also use JSON or YAML arrays (e.g. '["first", "second"]', "['first', 'second']") to make the action run multiple git add commands: the action will log how your input has been parsed. Please mind that your input still needs to be a string because of how GitHub Actions works with inputs: just write your array inside the string, the action will parse it later.

Deleting files:

You can delete files with the remove option: that runs a git rm command that will stage the files in the given path for removal. As with the add argument, you can use every option git rm allows (e.g. add --force to ignore .gitignore rules).
The script will not stop if one of the git commands fails. E.g.: if your command shows a "fatal: pathspec 'yourFile' did not match any files" error the action will go on.
You can also use JSON or YAML arrays (e.g. '["first", "second"]', "['first', 'second']") to make the action run multiple git rm commands: the action will log how your input has been parsed. Please mind that your input still needs to be a string because of how GitHub Actions works with inputs: just write your array inside the string, the action will parse it later.

Pushing:

By default the action runs the following command: git push origin ${branch input} --set-upstream. You can use the push input to modify this behavior, here's what you can set it to:

  • true: this is the default value, it will behave as usual.
  • false: this prevents the action from pushing at all, no git push command is run.
  • any other string:
    The action will use your string as the arguments for the git push command. Please note that nothing is used other than your arguments, and the command will result in git push ${push input} (no remote, no branch, no --set-upstream, you have to include them yourself).

One way to use this is if you want to force push to a branch of your repo: you'll need to set the push input to, for example, origin yourBranch --force.

Tagging:

You can use the tag option to enter the arguments for a git add command. In order for the action to isolate the tag name from the rest of the arguments, it should be the first word not preceded by an hyphen (e.g. -a tag-name -m "some other stuff" is ok).

Tokens:

When pushing, the action uses the token that the local git repository has been configured with: that means that if you want to change it you'll need to do it in the steps that run before this action. For example: if you set up your repo with actions/checkout then you have to add the token there.
Changing the token with which the repo is configured can be useful if you want to run CI checks on the commit pushed by this action; anyway, it has to be set up outside of this action.

About actions/checkout

The token you use when setting up the repo with this action will determine what token add-and-commit will use.
Some users reported that they were getting an error:

> fatal: could not read Username for 'https://github.com': No such device or address

If you're getting this error and you're using actions/[email protected], try upgrading to actions/[email protected]. If you're still having problems after upgrading, feel free to open an issue. Issue ref: #146

Outputs:

The action provides these outputs:

  • committed: whether the action has created a commit ('true' or 'false')
  • pushed: whether the action has pushed to the remote ('true' or 'false')
  • tagged: whether the action has created a tag ('true' or 'false')

For more info on how to use outputs, see "Context and expression syntax".

Examples:

If you don't want to use your GitHub username for the CI commits, you can also use the user provided by GitHub for this task:

on: push
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: EndBug/[email protected]
        with:
          author_name: github-actions
          author_email: 41898282+github-actions[bot]@users.noreply.github.com

41898282+github-actions[bot]@users.noreply.github.com is the mail of the original GitHub Actions bot. If you use that, the GitHub avatar is shown for the commits.

Do you want to lint your JavaScript files, located in the src folder, with ESLint, so that fixable changes are done without your intervention? You can use a workflow like this:

name: Lint source code
on: push

jobs:
  run:
    name: Lint with ESLint
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repo
        uses: actions/[email protected]

      - name: Set up Node.js
        uses: actions/[email protected]
        with:
          node-version: 12.x

      - name: Install dependencies
        run: npm install

      - name: Update source code
        run: eslint "src/**" --fix

      - name: Commit changes
        uses: EndBug/[email protected]
        with:
          author_name: Your Name
          author_email: [email protected]
          message: 'Your commit message'
          add: '*.js'

If you need to run the action on a repository that is not located in $GITHUB_WORKSPACE, you can use the cwd option: the action uses a cd normal command, so the path should follow bash standards.

name: Use a different repository directory
on: push

jobs:
  run:
    name: Add a text file
    runs-on: ubuntu-latest

    steps:
      # If you need to, you can check out your repo to a different location
      - uses: actions/[email protected]
        with:
          path: './pathToRepo/'

      # You can make whatever type of change to the repo...
      - run: echo "123" > ./pathToRepo/file.txt

      # ...and then use the action as you would normally do, but providing the path to the repo
      - uses: EndBug/[email protected]
        with:
          message: 'Add the very useful text file'
          add: '*.txt --force'
          cwd: './pathToRepo/'

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Federico Grandi

💻 📖

Tor Egil Jacobsen

💻

Ivan Yelizariev

🤔

jhhughes

🐛

Дмитрий Океаний

🤔

Brahma Dev

🐛

Felix Rojo Lapalma

🐛

Robin Wijnant

🐛 💻

Onilton Maciel

🤔

Josh Soref

📖

ToMe25

💻 🤔

JonasJacobsUserspace

🐛

pvogt09

💻

Connor Clark

🤔

Benedek Kozma

🤔 💻

Dustin Brown

🐛

Chris McIntosh

🐛

Kevin Saliou

🤔

Joachim Jablon

🤔

Tim Schwenke

🤔

Possible Triangle

🤔

Dominik Schilling

🤔 📖 💻

rugk

📖

This project follows the all-contributors specification. Contributions of any kind welcome!

License

This action is distributed under the MIT license, check the license for more info.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].