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 ab56290
Showing 1 changed file with 67 additions and 0 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/manual-create-pd-pr.yaml
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

0 comments on commit ab56290

Please sign in to comment.