Comments (2)
Hello, Github action set that env variable. default-environment-variables.
GITHUB_SHA: The commit SHA that triggered the workflow. For example, ffac537e6cbbf934b08745a378932722df287a53.
The correct use for "merge type: now" is filtering the branch name, following your example It should be like this:
staging->master
on:
push:
branches:
- 'staging'
jobs:
merge-branch:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Sync
uses: devmasx/[email protected]
with:
type: now
target_branch: 'master'
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
master->develop
on:
push:
branches:
- 'master'
jobs:
merge-branch:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Sync
uses: devmasx/[email protected]
with:
type: now
target_branch: 'develop'
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
Taking into account that we need to create 2 workflows files.
We can create an optional input, GITHUB_SHA or HEAD_TO_MERGE. But I'm not sure how it works if we try to sync multiple branches in the same workflow.
But the problem is If no filters are used, when finished workflow that will execute "merge staging->master", Github will trigger another workflow for the master branch. That means Github always triggers a workflow every time a branch has new changes.
I would really appreciate your help.
from merge-branch.
I just tried and I surprise, at the end of a merge Github doesn't trigger another workflow. 😆
Maybe that behavior only happens in the beta version of GithubActions or something change in the Github API, anyway right now I can add the new optional input in this PR #4.
Thanks! @Hatzelencio
from merge-branch.
Related Issues (20)
- Workflow doesn't trigger on labeled pull request HOT 4
- Can a Personal Access Token be used in place of github.token? HOT 2
- Frequent false positive merge conflicts
- 1.4.0 not found HOT 4
- Add an input to customize the merge message HOT 4
- Does this work with PRs from forks? HOT 3
- Merge commit no longer has a message HOT 2
- Avoid creating merge commit HOT 7
- Auto resolve conflicts HOT 2
- Bypass branch protection rule HOT 3
- delete merged branch? HOT 1
- Error while merging HOT 4
- Author other than bot
- merge silently skiped
- Resource not accessible by integration HOT 2
- Adding outputs to this action
- Feature: Ability to replace a branch instead of merge HOT 1
- 500 error HOT 9
- Getting 404 HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from merge-branch.