Resolve possible conflicts in software update PR (#1394)
* Resolve possible conflicts in software update PR * Push updated release branch to repo * Setup committer's name and email * Minor fix * Add step to create branch for PR * Add pause before merging * Minor renaming * Add step to delete docs branch
This commit is contained in:
@@ -11,6 +11,14 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Clone release branch to create pull request
|
||||||
|
run: |
|
||||||
|
git checkout ${{ github.event.client_payload.ReleaseBranchName }}
|
||||||
|
git branch ${{ github.event.client_payload.ReleaseBranchName }}-docs
|
||||||
|
git push origin ${{ github.event.client_payload.ReleaseBranchName }}-docs
|
||||||
|
|
||||||
- name: Create pull request for ${{ github.event.client_payload.ReleaseBranchName }}
|
- name: Create pull request for ${{ github.event.client_payload.ReleaseBranchName }}
|
||||||
uses: actions/github-script@v2
|
uses: actions/github-script@v2
|
||||||
@@ -21,7 +29,7 @@ jobs:
|
|||||||
owner: context.repo.owner,
|
owner: context.repo.owner,
|
||||||
repo: context.repo.repo,
|
repo: context.repo.repo,
|
||||||
title: "${{ github.event.client_payload.PullRequestTitle }}",
|
title: "${{ github.event.client_payload.PullRequestTitle }}",
|
||||||
head: "${{ github.event.client_payload.ReleaseBranchName }}",
|
head: "${{ github.event.client_payload.ReleaseBranchName }}-docs",
|
||||||
base: "${{ github.event.client_payload.PullRequestBase }}",
|
base: "${{ github.event.client_payload.PullRequestBase }}",
|
||||||
body: `${{ github.event.client_payload.PullRequestBody }}`
|
body: `${{ github.event.client_payload.PullRequestBody }}`
|
||||||
});
|
});
|
||||||
@@ -11,6 +11,17 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Resolve possible conflicts ${{ github.event.client_payload.ReleaseBranchName }} with main
|
||||||
|
run: |
|
||||||
|
git config --global user.email "[email protected]"
|
||||||
|
git config --global user.name "Actions service account"
|
||||||
|
git checkout ${{ github.event.client_payload.ReleaseBranchName }}-docs
|
||||||
|
git merge --no-edit --strategy-option=ours main
|
||||||
|
git push origin ${{ github.event.client_payload.ReleaseBranchName }}-docs
|
||||||
|
sleep 30
|
||||||
|
|
||||||
- name: Merge pull request for ${{ github.event.client_payload.ReleaseBranchName }}
|
- name: Merge pull request for ${{ github.event.client_payload.ReleaseBranchName }}
|
||||||
uses: actions/github-script@v2
|
uses: actions/github-script@v2
|
||||||
@@ -22,3 +33,14 @@ jobs:
|
|||||||
repo: context.repo.repo,
|
repo: context.repo.repo,
|
||||||
pull_number: ${{ github.event.client_payload.PullRequestNumber }}
|
pull_number: ${{ github.event.client_payload.PullRequestNumber }}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
- name: Delete docs branch ${{ github.event.client_payload.ReleaseBranchName }}-docs
|
||||||
|
uses: actions/github-script@v2
|
||||||
|
with:
|
||||||
|
github-token: ${{secrets.GITHUB_TOKEN}}
|
||||||
|
script: |
|
||||||
|
github.git.deleteRef({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
ref: "heads/${{ github.event.client_payload.ReleaseBranchName }}-docs"
|
||||||
|
})
|
||||||
Reference in New Issue
Block a user