diff --git a/.github/workflows/manual-create-pd-pr.yaml b/.github/workflows/manual-create-pd-pr.yaml new file mode 100644 index 0000000000..a871c64058 --- /dev/null +++ b/.github/workflows/manual-create-pd-pr.yaml @@ -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 "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/${{ 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