Avoid workflow get launched after commit in a loop !
See original GitHub issueDescribe the bug
I am using EndBug/add-and-commit@v5
but it launches a loop of Github Actions because, everytime there is a change the workflow get launched.
There is no support for that, and it looks like every body is gonna have the same issue.
Workflow used
name: Workflow branch master
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
name: Build and push image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.REPO_TOKEN }}
- name: Upgrade the version
run: |
VERSION=$(grep -oP '(?<=latest-)[0-9]+' ./.github/workflows/build-and-push-image-to-registry.yaml)
OLD_VERSION=$VERSION
NEW_VERSION=$(($VERSION + 1))
sed -i "s/latest-$OLD_VERSION/latest-$NEW_VERSION/g" ./scaleway/values.yaml
sed -i "s/latest-$OLD_VERSION/latest-$NEW_VERSION/g" ./.github/workflows/build-and-push-image-to-registry.yaml
- name: Commit changes
uses: EndBug/add-and-commit@v5
with:
message: "Robot version upgrade"
add: "."
env:
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}
Expected behavior
I wanna launch this workflow only if commit message is Robot version upgrade
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
github - Triggering a workflow run after an action commits
we have an action (runs manually) that commits to the pull-request (updating some files in the branch). when the second action finishes to...
Read more >trigger + workflow field change = infinite loop?
I'm trying to "prove" that triggers are done before workflows. So, in my trigger, I have it update a field "WhoIsLast" with the...
Read more >7 Github Actions Tricks I Wish I Knew Before I Started
#2: Reusable Workflows with Workflow Calls. Triggers are great, but this one gets a full title of its own. Now let's say you've...
Read more >Salesforce Flow Loops - Best Practices and Examples
To do this, create a Loop after the Get Records element. Use the Collection that was created in the Get Records element.
Read more >Looping within a Workflow Process - Oracle Blogs
This blog post contributed by Ajay Verma. ... Get Recipient Logic ... long running workflow loop can be easily avoided as done in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok apparently you just need to use the if condition
Thanks for the solution to this issue, I would expect it to be quite common. You can also do
if: github.event.head_commit.author.name != 'github-actions'
for example.