From 35d70c64750d27e3e18afe890ed392b5d874294c Mon Sep 17 00:00:00 2001 From: David Konigsberg <72822263+davidkonigsberg@users.noreply.github.com> Date: Mon, 28 Jul 2025 08:53:52 -0400 Subject: [PATCH 01/10] copy over fai def --- .github/workflows/sync-fern-definition.yml | 58 ++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/sync-fern-definition.yml diff --git a/.github/workflows/sync-fern-definition.yml b/.github/workflows/sync-fern-definition.yml new file mode 100644 index 0000000000..25b3b09061 --- /dev/null +++ b/.github/workflows/sync-fern-definition.yml @@ -0,0 +1,58 @@ +name: Sync Fern Definition + +on: + push: + branches: + - main + - "dak/ci/sync-fern-definition" + workflow_dispatch: + +permissions: + pull-requests: write + contents: write + +jobs: + copy-changelogs: + runs-on: ubuntu-latest + steps: + - name: Checkout main branch of fern-platform repo + uses: actions/checkout@v4 + with: + ref: main + + - name: Checkout main branch of docs repo + uses: actions/checkout@v4 + with: + repository: fern-api/docs + ref: main + path: docs + + - name: update fern definition + run: rsync -avu --delete "fern/apis/fai/" "docs/fern/apis/fai" + + - name: create PR + id: cpr + uses: peter-evans/create-pull-request@v7 + with: + token: ${{ secrets.GITHUB_TOKEN }} + commit-message: "update fern definition" + title: "Update fern definition" + branch: update-fern-definition + delete-branch: true + path: docs + + - name: Enable Pull Request Automerge + if: steps.cpr.outputs.pull-request-operation == 'created' + uses: peter-evans/enable-pull-request-automerge@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + pull-request-number: ${{ steps.cpr.outputs.pull-request-number }} + repository: fern-api/docs + merge-method: squash + + # - name: Approve PR + # if: steps.cpr.outputs.pull-request-operation == 'created' + # env: + # GH_TOKEN: ${{ secrets.PR_BOT_GH_PAT }} + # run: gh pr review ${{ steps.cpr.outputs.pull-request-number }} --repo fern-api/docs --approve + \ No newline at end of file From 1349281f3453ef1a45d1b14508a3d654775f1e80 Mon Sep 17 00:00:00 2001 From: David Konigsberg <72822263+davidkonigsberg@users.noreply.github.com> Date: Mon, 28 Jul 2025 08:55:58 -0400 Subject: [PATCH 02/10] create dir if not exist --- .github/workflows/sync-fern-definition.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sync-fern-definition.yml b/.github/workflows/sync-fern-definition.yml index 25b3b09061..1cb9bb54ab 100644 --- a/.github/workflows/sync-fern-definition.yml +++ b/.github/workflows/sync-fern-definition.yml @@ -28,7 +28,9 @@ jobs: path: docs - name: update fern definition - run: rsync -avu --delete "fern/apis/fai/" "docs/fern/apis/fai" + run: | + mkdir -p docs/fern/apis/fai + rsync -avu --delete "fern/apis/fai/" "docs/fern/apis/fai" - name: create PR id: cpr From ddc86cf420c0e7d88d77ee66884ede5b40c4b16b Mon Sep 17 00:00:00 2001 From: David Konigsberg <72822263+davidkonigsberg@users.noreply.github.com> Date: Mon, 28 Jul 2025 08:57:48 -0400 Subject: [PATCH 03/10] debug dir creation --- .github/workflows/sync-fern-definition.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/sync-fern-definition.yml b/.github/workflows/sync-fern-definition.yml index 1cb9bb54ab..6bf5fa0220 100644 --- a/.github/workflows/sync-fern-definition.yml +++ b/.github/workflows/sync-fern-definition.yml @@ -30,6 +30,7 @@ jobs: - name: update fern definition run: | mkdir -p docs/fern/apis/fai + ls docs/fern/apis rsync -avu --delete "fern/apis/fai/" "docs/fern/apis/fai" - name: create PR From 47d03803dd1286848d56f9c9cec3cbe496017c42 Mon Sep 17 00:00:00 2001 From: David Konigsberg <72822263+davidkonigsberg@users.noreply.github.com> Date: Mon, 28 Jul 2025 09:04:29 -0400 Subject: [PATCH 04/10] debug --- .github/workflows/sync-fern-definition.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sync-fern-definition.yml b/.github/workflows/sync-fern-definition.yml index 6bf5fa0220..57f467425a 100644 --- a/.github/workflows/sync-fern-definition.yml +++ b/.github/workflows/sync-fern-definition.yml @@ -30,7 +30,7 @@ jobs: - name: update fern definition run: | mkdir -p docs/fern/apis/fai - ls docs/fern/apis + ls fern/apis/fai/ rsync -avu --delete "fern/apis/fai/" "docs/fern/apis/fai" - name: create PR From 671bb9747d1a48434e395359900d83ec5faded8f Mon Sep 17 00:00:00 2001 From: David Konigsberg <72822263+davidkonigsberg@users.noreply.github.com> Date: Mon, 28 Jul 2025 09:05:35 -0400 Subject: [PATCH 05/10] continue debug --- .github/workflows/sync-fern-definition.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sync-fern-definition.yml b/.github/workflows/sync-fern-definition.yml index 57f467425a..fc0def9561 100644 --- a/.github/workflows/sync-fern-definition.yml +++ b/.github/workflows/sync-fern-definition.yml @@ -30,7 +30,8 @@ jobs: - name: update fern definition run: | mkdir -p docs/fern/apis/fai - ls fern/apis/fai/ + pwd + ls fern/apis rsync -avu --delete "fern/apis/fai/" "docs/fern/apis/fai" - name: create PR From b9e650ef9929097d6841cf366b4c5e083a7b72ca Mon Sep 17 00:00:00 2001 From: David Konigsberg <72822263+davidkonigsberg@users.noreply.github.com> Date: Mon, 28 Jul 2025 09:07:39 -0400 Subject: [PATCH 06/10] fix branch name --- .github/workflows/sync-fern-definition.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sync-fern-definition.yml b/.github/workflows/sync-fern-definition.yml index fc0def9561..e277f32936 100644 --- a/.github/workflows/sync-fern-definition.yml +++ b/.github/workflows/sync-fern-definition.yml @@ -18,7 +18,7 @@ jobs: - name: Checkout main branch of fern-platform repo uses: actions/checkout@v4 with: - ref: main + ref: app - name: Checkout main branch of docs repo uses: actions/checkout@v4 From c85f245b0daccb294340d3cae4414e786de03d20 Mon Sep 17 00:00:00 2001 From: David Konigsberg <72822263+davidkonigsberg@users.noreply.github.com> Date: Mon, 28 Jul 2025 09:10:46 -0400 Subject: [PATCH 07/10] Use different GH token --- .github/workflows/sync-fern-definition.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/sync-fern-definition.yml b/.github/workflows/sync-fern-definition.yml index e277f32936..99f5b05707 100644 --- a/.github/workflows/sync-fern-definition.yml +++ b/.github/workflows/sync-fern-definition.yml @@ -28,17 +28,13 @@ jobs: path: docs - name: update fern definition - run: | - mkdir -p docs/fern/apis/fai - pwd - ls fern/apis - rsync -avu --delete "fern/apis/fai/" "docs/fern/apis/fai" + run: rsync -avu --delete "fern/apis/fai/" "docs/fern/apis/fai" - name: create PR id: cpr uses: peter-evans/create-pull-request@v7 with: - token: ${{ secrets.GITHUB_TOKEN }} + token: ${{ secrets.FERN_GITHUB_TOKEN }} commit-message: "update fern definition" title: "Update fern definition" branch: update-fern-definition @@ -49,7 +45,7 @@ jobs: if: steps.cpr.outputs.pull-request-operation == 'created' uses: peter-evans/enable-pull-request-automerge@v3 with: - token: ${{ secrets.GITHUB_TOKEN }} + token: ${{ secrets.FERN_GITHUB_TOKEN }} pull-request-number: ${{ steps.cpr.outputs.pull-request-number }} repository: fern-api/docs merge-method: squash From bb943c3e2778c4df55048c13dec7b985e1915deb Mon Sep 17 00:00:00 2001 From: David Konigsberg <72822263+davidkonigsberg@users.noreply.github.com> Date: Mon, 28 Jul 2025 09:12:35 -0400 Subject: [PATCH 08/10] auto-merge --- .github/workflows/sync-fern-definition.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/sync-fern-definition.yml b/.github/workflows/sync-fern-definition.yml index 99f5b05707..cf6bbc26a2 100644 --- a/.github/workflows/sync-fern-definition.yml +++ b/.github/workflows/sync-fern-definition.yml @@ -50,9 +50,9 @@ jobs: repository: fern-api/docs merge-method: squash - # - name: Approve PR - # if: steps.cpr.outputs.pull-request-operation == 'created' - # env: - # GH_TOKEN: ${{ secrets.PR_BOT_GH_PAT }} - # run: gh pr review ${{ steps.cpr.outputs.pull-request-number }} --repo fern-api/docs --approve + - name: Approve PR + if: steps.cpr.outputs.pull-request-operation == 'created' + env: + GH_TOKEN: ${{ secrets.PR_BOT_GH_PAT }} + run: gh pr review ${{ steps.cpr.outputs.pull-request-number }} --repo fern-api/docs --approve \ No newline at end of file From a07799715aa0afb4598e5e1e28105a4694dc682d Mon Sep 17 00:00:00 2001 From: David Konigsberg <72822263+davidkonigsberg@users.noreply.github.com> Date: Mon, 28 Jul 2025 09:14:14 -0400 Subject: [PATCH 09/10] rename branch --- .github/workflows/sync-fern-definition.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/sync-fern-definition.yml b/.github/workflows/sync-fern-definition.yml index cf6bbc26a2..55b6256cfd 100644 --- a/.github/workflows/sync-fern-definition.yml +++ b/.github/workflows/sync-fern-definition.yml @@ -3,8 +3,7 @@ name: Sync Fern Definition on: push: branches: - - main - - "dak/ci/sync-fern-definition" + - app workflow_dispatch: permissions: From 0040793167f4b229685ef6e60b9247420fecbdd9 Mon Sep 17 00:00:00 2001 From: David Konigsberg <72822263+davidkonigsberg@users.noreply.github.com> Date: Mon, 28 Jul 2025 09:17:01 -0400 Subject: [PATCH 10/10] rename job --- .github/workflows/sync-fern-definition.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sync-fern-definition.yml b/.github/workflows/sync-fern-definition.yml index 55b6256cfd..fbf4d79ea2 100644 --- a/.github/workflows/sync-fern-definition.yml +++ b/.github/workflows/sync-fern-definition.yml @@ -11,7 +11,7 @@ permissions: contents: write jobs: - copy-changelogs: + sync-fern-definition: runs-on: ubuntu-latest steps: - name: Checkout main branch of fern-platform repo