GithubHelp home page GithubHelp logo

action-commit-to-branch's People

Contributors

dereksmart avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

action-commit-to-branch's Issues

Commits not getting picked up

On the initial run where my built branch (main-built) does not exist, everything works as expected. However, when adding subsequent commits to main, the action is not committing them to main-built. Am I misunderstanding any functionality here?

Example .yml:

name: Build production to main-built
on:
  push:
    branches:
      - main
jobs:
  build_main_job:
    runs-on: ubuntu-latest
    name: Build production version of main to main-built branch
    steps:
      - name: Checkout Repo
        uses: actions/checkout@v2
      - name: Push to built branch
        id: commit-and-push
        uses: Automattic/action-commit-to-branch@master
        with:
          branch: 'main-built'
          commit_message: 'Automated production build from main'
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Log from my .yml:

Fetching origin
No local changes to save
Branch 'main-built' set up to track remote branch 'main-built' from 'origin'.
Switched to a new branch 'main-built'
No stash entries found.
On branch main-built
Your branch is up to date with 'origin/main-built'.

nothing to commit, working tree clean
Branch 'main-built' set up to track remote branch 'main-built' from 'origin'.
Everything up-to-date

Is this expected behavior? I had assumed that subsequent commits added to main would be picked up by main-built, but looking at entrypoint.sh that doesn't seem to be the case.

edit: not sure if this change is the correct approach for solving this.

Possibility to update the branch after the checkout?

I got a situation when the master branch was not up-to-date:

Run Automattic/action-commit-to-branch@master
/usr/bin/docker run --name ...
Fetching origin
From https://github.com/BoboTiG/ebook-reader-dict
   55ea47a..27d8af6  master     -> origin/master
Fetching origin
Saved working directory and index state WIP on master: 55ea47a GH Actions: make the word effective
Already on 'master'
Your branch is behind 'origin/master' by 1 commit, and can be fast-forwarded.
  (use "git pull" to update your local branch)
On branch master
Your branch is behind 'origin/master' by 1 commit, and can be fast-forwarded.
  (use "git pull" to update your local branch)

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   data/fr/words.count
	modified:   data/fr/words.list
	modified:   data/fr/words.snapshot

no changes added to commit (use "git add" and/or "git commit -a")
Dropped refs/stash@{0} (7a2afab41780911ef60d445dc419ab5641a112f1)
[master a4f95a1] Updated dicthtml-fr (1758426 words)
 3 files changed, 1758428 insertions(+)
To https://github.com/BoboTiG/ebook-reader-dict
 ! [rejected]        master -> master (non-fast-forward)

I might have this issue more frequently as jobs are running concurrently and all are pushing to master.
Do you think it would be possible to add git pull just after doing the checkout?

Failed to adjust OOM score for shim: invalid argument error

We have been facing the following issue while applying action-commit-to-branch recently:

io.containerd.runc.v2: failed to adjust OOM score for shim: set shim OOM score: write /proc/244/oom_score_adj: invalid argument

After some brief investigation, we have seen some recently problems related to Docker Dind version 20. It may help to take a look into the related similar problems Links.

** Github Action Code:**

      - name: Push fmt changes to PR branch
        if: steps.fmt.outputs.stdout != ''
        uses: Automattic/action-commit-to-branch@master
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          branch: ${{ github.head_ref }}
          commit_message: 'Apply fmt changes'

Full Github Action Logs:

If necessary I can provide Full Github Action Log Files.

Related similar problems

containerd/containerd#4837
https://discourse.drone.io/t/docker-build-failures-from-oom-score-adjustments/8492/2

How to execute bash command in commit_message

@dereksmart
I want my commit message to contain a bash script to get a value from a file, is it doable?

Something like this

- name: Push to staging branch
   uses: Automattic/action-commit-to-branch@master
   with:
     branch: 'staging'
     commit_message: ${ echo "Increase version to $(sed -rn 's/^version=([^\n]+)$/\1/p' file.properties)"}

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.