Comments (9)
@peter-evans Below changes works fine for me.
name: Create Pull Request
on:
push:
schedule:
- cron: '0 8 * * MON'
jobs:
createPullRequest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: master
- name: Reset develop branch
run: |
git fetch origin develop:develop
git reset --hard develop
- name: Create Pull Request
id: cpr
uses: peter-evans/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Merge `development` to `master`
title: Merge develop to master
body: |
Auto-generated PR to make sure our master branch should have the latest code
labels: ready for review
branch: develop-promotion
- name: Check outputs
run: |
echo "Pull Request Number - ${{ env.PULL_REQUEST_NUMBER }}"
echo "Pull Request Number - ${{ steps.cpr.outputs.pr_number }}"
Thanks for the help!!!!
from create-pull-request.
@JigarM You can do that, yes. Please see this example.
Here is what that pattern would look like for your workflow. It checks out master
, resets to develop
, and then creates a PR to merge into master. The PR branch is named master-promotion
(you can rename it to whatever you want, but don't use an existing branch).
steps:
- uses: actions/checkout@v2
- name: Reset promotion branch
run: |
git fetch origin develop:develop
git reset --hard develop
- name: Create Pull Request
id: cpr
uses: peter-evans/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Merge development to master
title: '[Example] Add report file'
body: |
Auto-generated PR to make sure our `master` branch should have the latest code
labels: ready for review
assignees: JigarM
reviewers: JigarM
branch: master-promotion
from create-pull-request.
@peter-evans Thanks for the quick response. Let me try this way.
I did the mistake to set the PR branch name with existing branch. I hope it should work. Will update you here.
Thanks anyway.!!!
from create-pull-request.
@peter-evans One more thing I want to share. Github action can't trigger the workflow on schedule time. such as when I write this, nothing happens.
on:
schedule:
- cron: '0 8 * * MON'
But when I add push, the action triggered on push
on:
push:
schedule:
- cron: '0 8 * * MON'
So, how we can schedule without "push" call?
from create-pull-request.
Maybe MON
isn't an accepted way to set the cron schedule. Try using digits to set the day instead.
on:
schedule:
- cron: '0 8 * * 1'
from create-pull-request.
@peter-evans That's not an issue. Even I tried cron: "*/2 * * * *"
but still its not working.
YML is not calling at every 2 minutes.
That's why I need to add push in the yml.
from create-pull-request.
Do I need to update the yml with PAT(Personal access token)?
from create-pull-request.
You can't schedule it every 2 minutes. The shortest is 5.
The shortest interval you can run scheduled workflows is once every 5 minutes.
https://help.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events-schedule
Also, make sure the workflow is in the master
(default) branch. It won't trigger otherwise.
Do I need to update the yml with PAT(Personal access token)?
No, this is not necessary for your use case.
from create-pull-request.
Got it!!!
@peter-evans Thanks for correcting me. Changes runs fine now.
Thanks for everything..
from create-pull-request.
Related Issues (20)
- `push-to-fork` won't push to sibling repos in the same network HOT 3
- add a no-verify option HOT 1
- Support commenting on a PR when closing it HOT 4
- PR is geeting auto merge HOT 1
- Commit author is `web-flow`? HOT 3
- Fine-grained PATs will also work HOT 2
- Upgrade action to use node20 HOT 4
- Commit message not updated when PR is updated HOT 1
- Actions not triggering even with Custom App HOT 6
- Photo from Tajdoost
- stale info error when specified branch doesn't exist but a tag with the same name exists HOT 2
- Add no-verify option because rm -rf .git/hooks doesn't work HOT 2
- Github Action is not working HOT 1
- This isn't recognizing changes between two branches of two repos HOT 2
- using with git-crypt HOT 4
- Is it possible to fully restore all git state after the action? HOT 5
- Deep fetch results in massive download HOT 2
- Whatever
- Question about Repository HOT 1
- Adobe Save America Series
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 create-pull-request.