From f54fdb649160faec8e1fd2ca2774ae225ab17a11 Mon Sep 17 00:00:00 2001 From: Suhaha Date: Tue, 6 Jul 2021 18:14:52 +0800 Subject: [PATCH 1/2] Create PR in PD as CD (#947) --- .github/workflows/release.yaml | 44 ++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 75f96a8a8f..4e3814b8d4 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -8,6 +8,8 @@ on: jobs: release: runs-on: ubuntu-latest + outputs: + release_version: v${{ steps.lookup_release_version.outputs.release_version }} steps: - name: Checkout code uses: actions/checkout@v2 @@ -78,3 +80,45 @@ jobs: asset_path: ./embedded-assets-golang.zip asset_name: embedded-assets-golang.zip asset_content_type: application/zip + create_pr_to_pd: + runs-on: ubuntu-latest + needs: release + steps: + - name: Check out to pd + uses: actions/checkout@master + with: + repository: tikv/pd + token: ${{ secrets.BOT_PAT }} + - name: Setup go + uses: actions/setup-go@v2 + with: + go-version: "1.16.5" + - name: Update dashboard + run: | + go get -d "github.com/pingcap/tidb-dashboard@${{ needs.release.outputs.release_version }}" + go mod tidy + make pd-server + go mod tidy + - name: Git commit + 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 --message "Update from https://github.com/$GITHUB_REPOSITORY/commit/$GITHUB_SHA, release version: ${{ needs.release.outputs.release_version }}" + echo "::set-output name=committed::1" + else + echo "No changes detected" + fi + - name: Create Pull Request + uses: peter-evans/create-pull-request@v3 + if: steps.git_commit.outputs.committed == 1 + with: + token: ${{ secrets.BOT_PAT }} + signoff: true + branch: update-dashboard-${{ needs.release.outputs.release_version }} + title: Update TiDB Dashboard to ${{ needs.release.outputs.release_version }} + body: Update TiDB dashboard from https://github.com/${{ env.GITHUB_REPOSITORY }}/commit/${{ env.GITHUB_SHA }}, release version is ${{ needs.release.outputs.release_version }} + push-to-fork: tidb-dashboard-bot/pd From 86d284c7a7af2d98d81c4f17e78253528ab9bd9a Mon Sep 17 00:00:00 2001 From: Suhaha Date: Fri, 23 Jul 2021 12:21:54 +0800 Subject: [PATCH 2/2] fix: markdownlint-cli error --- scripts/lint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/lint.sh b/scripts/lint.sh index 63091c6686..568969660a 100755 --- a/scripts/lint.sh +++ b/scripts/lint.sh @@ -32,4 +32,4 @@ echo "+ Clean up go mod" go mod tidy echo "+ Run lints for docs" -npm_config_yes=true npx markdownlint-cli docs/**/*.md +npm_config_yes=true npx markdownlint-cli@0.27.0 docs/**/*.md