create automatic PR #2257
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: create automatic PR | |
on: | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: "1 * * * *" | |
jobs: | |
updateAuthor: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checking out code | |
uses: actions/checkout@v2 | |
- name: extract git commit data | |
uses: rlespinasse/git-commit-data-action@v1.x | |
- name: Update author information | |
run: | | |
d=`date '+%Y-%m-%dT%H:%M:%SZ'` | |
echo ${{ env.GIT_COMMIT_AUTHOR_NAME }} $d > AUTHOR | |
- name: Raise PR 1 | |
id: demo-1 | |
uses: peter-evans/create-pull-request@v3 | |
with: | |
branch: "PR-Bot" | |
base: main | |
title: "Pull Request." | |
committer: ${{ env.GIT_COMMIT_AUTHOR_NAME }} <${{ env.GIT_COMMIT_AUTHOR_EMAIL }}"> | |
author: ${{ env.GIT_COMMIT_AUTHOR_NAME }} <${{ env.GIT_COMMIT_AUTHOR_EMAIL }}"> | |
body: | |
Pull Request. | |
token: ${{ secrets.GITHUB_TOKEN }} | |
delete-branch: true | |
- name: Approve Pull Request1 | |
uses: juliangruber/approve-pull-request-action@v1 | |
with: | |
github-token: ${{ secrets.APPROVER_DEMO }} | |
number: ${{ steps.demo-1.outputs.pull-request-number }} | |
- name: Merge Pull request1 | |
uses: juliangruber/merge-pull-request-action@v1 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
number: ${{ steps.demo-1.outputs.pull-request-number }} | |
method: squash | |
- name: Update author information again | |
run: | | |
d=`date '+%Y-%m-%dT%H:%M:%SZ'` | |
echo 3bsalam-1 $d > AUTHOR | |
- name: Raise PR 2 | |
id: demo-2 | |
uses: peter-evans/create-pull-request@v3 | |
with: | |
branch: "PR-Bot2" | |
base: main | |
title: "Pull Request.." | |
committer: ${{ env.GIT_COMMIT_AUTHOR_NAME }} <${{ env.GIT_COMMIT_AUTHOR_EMAIL }}"> | |
author: ${{ env.GIT_COMMIT_AUTHOR_NAME }} <${{ env.GIT_COMMIT_AUTHOR_EMAIL }}"> | |
body: | |
Pull Request.. | |
token: ${{ secrets.GITHUB_TOKEN }} | |
delete-branch: true | |
- name: Approve Pull Request2 | |
uses: juliangruber/approve-pull-request-action@v1 | |
with: | |
github-token: ${{ secrets.APPROVER_DEMO }} | |
number: ${{ steps.demo-2.outputs.pull-request-number }} | |
- name: Merge Pull request2 | |
uses: juliangruber/merge-pull-request-action@v1 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
number: ${{ steps.demo-2.outputs.pull-request-number }} | |
method: squash |