-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a workflow to create PD PR manually (#953)
- Loading branch information
1 parent
65b20bd
commit ab56290
Showing
1 changed file
with
67 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: Create PD PR Manually | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
release_version: | ||
description: "Release version, e.g. v2021.07.09.1" | ||
required: true | ||
|
||
jobs: | ||
pd_pr: | ||
name: Create PD PR | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
branch: [master, release-4.0, release-5.0, release-5.1] | ||
steps: | ||
- name: Check out PD code base | ||
uses: actions/checkout@master | ||
with: | ||
repository: tikv/pd | ||
ref: ${{ matrix.branch }} | ||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: "1.16.5" | ||
- name: Update TiDB Dashboard in PD code base | ||
run: | | ||
go get -d "github.com/pingcap/tidb-dashboard@${{ github.event.inputs.release_version }}" | ||
go mod tidy | ||
make pd-server | ||
go mod tidy | ||
- name: Commit PD code base change | ||
id: git_commit | ||
run: | | ||
git config user.name "tidb-dashboard-bot" | ||
git config user.email "tidb-dashboard-bot@pingcap.com" | ||
git add go.mod go.sum | ||
if git status | grep -q "Changes to be committed" | ||
then | ||
git commit --signoff --message "Update TiDB Dashboard to ${{ github.event.inputs.release_version }}" | ||
echo "::set-output name=committed::1" | ||
else | ||
echo "No changes detected, skipped" | ||
fi | ||
- name: Set build ID | ||
id: build_id | ||
run: echo "::set-output name=id::$(date +%s)" | ||
- name: Create PR based on PD code base | ||
uses: peter-evans/create-pull-request@v3 | ||
if: steps.git_commit.outputs.committed == 1 | ||
with: | ||
token: ${{ secrets.BOT_PAT }} | ||
branch: update-tidb-dashboard/${{ matrix.branch }}-${{ github.event.inputs.release_version }}-${{ steps.build_id.outputs.id }} | ||
title: Update TiDB Dashboard to ${{ github.event.inputs.release_version }} [${{ matrix.branch }}] | ||
body: | | ||
### What problem does this PR solve? | ||
Update TiDB Dashboard to ${{ github.event.inputs.release_version }}. | ||
Upstream commit: https://github.com/${{ github.repository }}/commit/${{ github.sha }} . | ||
### Release note | ||
```release-note | ||
None | ||
``` | ||
push-to-fork: tidb-dashboard-bot/pd |