From e3e954e94266b06836b202f7be231b7ed18e6a49 Mon Sep 17 00:00:00 2001 From: Xavier Chanthavong Date: Thu, 25 Jan 2024 21:14:53 +0000 Subject: [PATCH 01/10] docs(GITBOOK#15): No subject From abd9430ecc61f5c306e0b727d29054e62e7dfe9e Mon Sep 17 00:00:00 2001 From: xavierchanth Date: Thu, 25 Jan 2024 16:30:52 -0500 Subject: [PATCH 02/10] ci: add gitbook automated PR workflow --- .github/workflows/gitbook.yaml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/gitbook.yaml diff --git a/.github/workflows/gitbook.yaml b/.github/workflows/gitbook.yaml new file mode 100644 index 000000000..c282cd513 --- /dev/null +++ b/.github/workflows/gitbook.yaml @@ -0,0 +1,27 @@ +name: Gitbook Review +on: + push: + branches: + - gitbook + +jobs: + create-pull-request: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + + - name: Create Pull Request + uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38 # v5.0.2 + with: + token: ${{ secrets.MY_GITHUB_TOKEN }} + committer: library-action[bot] <41898282+github-actions[bot]@users.noreply.github.com> + author: library-action[bot] <41898282+github-actions[bot]@users.noreply.github.com> + base: gitbook + branch: bot-new-stable-version + delete-branch: true + title: 'chore(gitbook): Update Gitbook Docs' + body: | + Automated PR to update the gitbook docs. + reviewers: xavierchanth + draft: false From 33cfa975a6f2d41b818adb7aa13bc0558057fdeb Mon Sep 17 00:00:00 2001 From: xavierchanth Date: Thu, 25 Jan 2024 16:33:33 -0500 Subject: [PATCH 03/10] ci: correct gitbook workflow params --- .github/workflows/gitbook.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/gitbook.yaml b/.github/workflows/gitbook.yaml index c282cd513..4ee176c49 100644 --- a/.github/workflows/gitbook.yaml +++ b/.github/workflows/gitbook.yaml @@ -17,9 +17,8 @@ jobs: token: ${{ secrets.MY_GITHUB_TOKEN }} committer: library-action[bot] <41898282+github-actions[bot]@users.noreply.github.com> author: library-action[bot] <41898282+github-actions[bot]@users.noreply.github.com> - base: gitbook - branch: bot-new-stable-version - delete-branch: true + base: trunk + branch: gitbook title: 'chore(gitbook): Update Gitbook Docs' body: | Automated PR to update the gitbook docs. From 2d29115f0712009c6af7279513c5cf7c10485f6f Mon Sep 17 00:00:00 2001 From: xavierchanth Date: Thu, 25 Jan 2024 16:35:29 -0500 Subject: [PATCH 04/10] ci: checkout ref gitbook --- .github/workflows/gitbook.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/gitbook.yaml b/.github/workflows/gitbook.yaml index 4ee176c49..a1970ff7d 100644 --- a/.github/workflows/gitbook.yaml +++ b/.github/workflows/gitbook.yaml @@ -10,6 +10,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + ref: gitbook - name: Create Pull Request uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38 # v5.0.2 From 7c0902d00d44cc8ec85c65b8d9b1c8a9078e0df3 Mon Sep 17 00:00:00 2001 From: xavierchanth Date: Thu, 25 Jan 2024 16:39:14 -0500 Subject: [PATCH 05/10] ci: try using origin/gitbook as branch --- .github/workflows/gitbook.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/gitbook.yaml b/.github/workflows/gitbook.yaml index a1970ff7d..edeb7b92b 100644 --- a/.github/workflows/gitbook.yaml +++ b/.github/workflows/gitbook.yaml @@ -10,8 +10,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - with: - ref: gitbook - name: Create Pull Request uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38 # v5.0.2 @@ -19,8 +17,7 @@ jobs: token: ${{ secrets.MY_GITHUB_TOKEN }} committer: library-action[bot] <41898282+github-actions[bot]@users.noreply.github.com> author: library-action[bot] <41898282+github-actions[bot]@users.noreply.github.com> - base: trunk - branch: gitbook + branch: origin/gitbook title: 'chore(gitbook): Update Gitbook Docs' body: | Automated PR to update the gitbook docs. From d204a52b40439ccd361c1eaa176a2d47ef9045f2 Mon Sep 17 00:00:00 2001 From: xavierchanth Date: Thu, 25 Jan 2024 16:40:40 -0500 Subject: [PATCH 06/10] ci: add base:trunk back --- .github/workflows/gitbook.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/gitbook.yaml b/.github/workflows/gitbook.yaml index edeb7b92b..11202d9f2 100644 --- a/.github/workflows/gitbook.yaml +++ b/.github/workflows/gitbook.yaml @@ -17,6 +17,7 @@ jobs: token: ${{ secrets.MY_GITHUB_TOKEN }} committer: library-action[bot] <41898282+github-actions[bot]@users.noreply.github.com> author: library-action[bot] <41898282+github-actions[bot]@users.noreply.github.com> + base: trunk branch: origin/gitbook title: 'chore(gitbook): Update Gitbook Docs' body: | From c0cf4accba2c7cb0cfc5ed5b682255ad8c1ff8a1 Mon Sep 17 00:00:00 2001 From: xavierchanth Date: Thu, 25 Jan 2024 16:53:38 -0500 Subject: [PATCH 07/10] ci: Use gh cli to create PR --- .github/workflows/gitbook.yaml | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/.github/workflows/gitbook.yaml b/.github/workflows/gitbook.yaml index 11202d9f2..2d5fd52d2 100644 --- a/.github/workflows/gitbook.yaml +++ b/.github/workflows/gitbook.yaml @@ -11,16 +11,17 @@ jobs: - name: Checkout uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - name: Authenticate GitHub CLI + run: | + gh auth login --with-token ${{ secrets.MY_GITHUB_TOKEN }} + - name: Create Pull Request - uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38 # v5.0.2 - with: - token: ${{ secrets.MY_GITHUB_TOKEN }} - committer: library-action[bot] <41898282+github-actions[bot]@users.noreply.github.com> - author: library-action[bot] <41898282+github-actions[bot]@users.noreply.github.com> - base: trunk - branch: origin/gitbook - title: 'chore(gitbook): Update Gitbook Docs' - body: | - Automated PR to update the gitbook docs. - reviewers: xavierchanth - draft: false + run: | + gh_pr_up() { gh pr create $* || gh pr edit $* } + gh_pr_up \ + --base 'trunk' \ + --head 'gitbook' \ + --title 'chore(gitbook): Update Gitbook Docs' \ + --body 'Automated PR to update gitbook docs.' \ + --reviewer 'xavierchanth' \ + --fill From 075a67635fb74eed8d132aed259f6e327bc765bc Mon Sep 17 00:00:00 2001 From: xavierchanth Date: Thu, 25 Jan 2024 16:55:56 -0500 Subject: [PATCH 08/10] ci: pipe token to login --- .github/workflows/gitbook.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gitbook.yaml b/.github/workflows/gitbook.yaml index 2d5fd52d2..718b3a2a9 100644 --- a/.github/workflows/gitbook.yaml +++ b/.github/workflows/gitbook.yaml @@ -13,7 +13,7 @@ jobs: - name: Authenticate GitHub CLI run: | - gh auth login --with-token ${{ secrets.MY_GITHUB_TOKEN }} + ${{ secrets.MY_GITHUB_TOKEN }} | gh auth login --with-token - name: Create Pull Request run: | From 4ac48f46aa1ffed370d2960a1d27cb3b54cf8748 Mon Sep 17 00:00:00 2001 From: xavierchanth Date: Thu, 25 Jan 2024 16:57:21 -0500 Subject: [PATCH 09/10] fix: echo token to login --- .github/workflows/gitbook.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gitbook.yaml b/.github/workflows/gitbook.yaml index 718b3a2a9..233162473 100644 --- a/.github/workflows/gitbook.yaml +++ b/.github/workflows/gitbook.yaml @@ -13,7 +13,7 @@ jobs: - name: Authenticate GitHub CLI run: | - ${{ secrets.MY_GITHUB_TOKEN }} | gh auth login --with-token + echo -e ${{ secrets.MY_GITHUB_TOKEN }} | gh auth login --with-token - name: Create Pull Request run: | From 74f1a9a77bba8b303a50a5e7561a43e34472d49c Mon Sep 17 00:00:00 2001 From: xavierchanth Date: Thu, 25 Jan 2024 16:58:23 -0500 Subject: [PATCH 10/10] fix: add newline to eof --- .github/workflows/gitbook.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/gitbook.yaml b/.github/workflows/gitbook.yaml index 233162473..2080285e8 100644 --- a/.github/workflows/gitbook.yaml +++ b/.github/workflows/gitbook.yaml @@ -25,3 +25,4 @@ jobs: --body 'Automated PR to update gitbook docs.' \ --reviewer 'xavierchanth' \ --fill +