automattic / action-commit-to-branch Goto Github PK
View Code? Open in Web Editor NEWGitHub action that will commit the result to an input branch
GitHub action that will commit the result to an input branch
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.
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
@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)"}
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.