Skip to content

Commit

Permalink
Add a workflow to create PD PR manually (#953)
Browse files Browse the repository at this point in the history
  • Loading branch information
breezewish committed Jul 9, 2021
1 parent 65b20bd commit b4a5d28
Showing 1 changed file with 69 additions and 0 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/manual-create-pd-pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
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
steps:
- name: Check out PD code base
uses: actions/checkout@master
with:
repository: tikv/pd
- 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 "[email protected]"
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/${{ github.event.inputs.release_version }}-${{ steps.build_id.outputs.id }}
title: Update TiDB Dashboard to ${{ github.event.inputs.release_version }}
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 }} .
### Check List
Related changes
- Need to cherry-pick to the release branch
### Release note
```release-note
Update TiDB Dashboard to ${{ github.event.inputs.release_version }}
```
push-to-fork: tidb-dashboard-bot/pd

0 comments on commit b4a5d28

Please sign in to comment.