From 489bd2655a794fbde278e78381b40549159ff397 Mon Sep 17 00:00:00 2001 From: xiaolou86 <20718693+xiaolou86@users.noreply.github.com> Date: Wed, 31 Jan 2024 15:34:57 +0800 Subject: [PATCH 01/21] Update _typos.toml --- _typos.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/_typos.toml b/_typos.toml index 64b353ac7d..74b5bc3b43 100644 --- a/_typos.toml +++ b/_typos.toml @@ -5,3 +5,7 @@ check-file = false extend-glob = ["*.adoc"] check-file = true +[default.extend-words] +# Don't correct the word +afe = "afe" + From ef59b197959dbc399118925f47edafdcb7799c87 Mon Sep 17 00:00:00 2001 From: xiaolou86 <20718693+xiaolou86@users.noreply.github.com> Date: Wed, 31 Jan 2024 15:48:09 +0800 Subject: [PATCH 02/21] fix: generate previews from forked repos --- .github/workflows/pull_request.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 6f576bfe25..d3b634d974 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -9,6 +9,9 @@ on: # branches: # - main +permissions: + contents: write + jobs: typos: From 49a81281fd73a0e04843d9b495034305d419c39c Mon Sep 17 00:00:00 2001 From: xiaolou86 <20718693+xiaolou86@users.noreply.github.com> Date: Wed, 31 Jan 2024 15:54:17 +0800 Subject: [PATCH 03/21] fix: generate previews from forked repos --- .github/workflows/pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index d3b634d974..fe9d23e319 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -58,7 +58,7 @@ jobs: with: node-version: 16 ref: gh-pages - USER_TOKEN: ${{ secrets.USER_TOKEN }} + #USER_TOKEN: ${{ secrets.USER_TOKEN }} - name: Extract PR details id: pr From 40c8b99a086d757af04bcb80356c114e116bcebc Mon Sep 17 00:00:00 2001 From: xiaolou86 <20718693+xiaolou86@users.noreply.github.com> Date: Wed, 31 Jan 2024 16:01:11 +0800 Subject: [PATCH 04/21] fix: generate previews from forked repos --- .github/workflows/pull_request.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index fe9d23e319..7d571dfe7d 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -91,9 +91,8 @@ jobs: ls -al echo "Git status:" git status + git config -l - git config user.name "GitHub Actions" - git config user.email noreply@github.com git add . From f85fa4fe4b89ab24d52d60281e54bddd0d31f751 Mon Sep 17 00:00:00 2001 From: xiaolou86 <20718693+xiaolou86@users.noreply.github.com> Date: Fri, 2 Feb 2024 15:46:25 +0800 Subject: [PATCH 05/21] fix: generate previews from forked repos --- .github/workflows/pull_request.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 7d571dfe7d..d585b2f0c8 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -12,6 +12,7 @@ on: permissions: contents: write + jobs: typos: From eececaf39207a8cda5fe1869a79debb3a404effa Mon Sep 17 00:00:00 2001 From: xiaolou86 <20718693+xiaolou86@users.noreply.github.com> Date: Fri, 2 Feb 2024 16:35:05 +0800 Subject: [PATCH 06/21] fix: generate previews from forked repos --- .github/workflows/pull_request.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index d585b2f0c8..0f6fd726d2 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -9,8 +9,8 @@ on: # branches: # - main -permissions: - contents: write +#permissions: +# contents: write jobs: From f580c2c3815e724969d0a015a3ec43243d94f5b6 Mon Sep 17 00:00:00 2001 From: xiaolou86 <20718693+xiaolou86@users.noreply.github.com> Date: Fri, 2 Feb 2024 16:55:40 +0800 Subject: [PATCH 07/21] fix: generate previews from forked repos --- .github/workflows/push.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 698c07f230..405c89489e 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -2,9 +2,6 @@ name: Push workflow on: push: - branches: -# - dev - - main jobs: release-version: From 6fb296d5913c6b26ef4316285a218b19f6ebc588 Mon Sep 17 00:00:00 2001 From: xiaolou86 <20718693+xiaolou86@users.noreply.github.com> Date: Fri, 2 Feb 2024 17:02:35 +0800 Subject: [PATCH 08/21] fix: generate previews from forked repos --- .github/workflows/push.yml | 135 +++++++++++++++++++++++++++++++------ 1 file changed, 114 insertions(+), 21 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 405c89489e..b502361ea9 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -4,36 +4,129 @@ on: push: jobs: - release-version: - name: Releasing a version + + test-deploy: + name: Test deploy runs-on: ubuntu-latest - if: ${{ !contains(github.event.head_commit.message, 'chore') || (github.ref_name == 'main' && !contains(github.event.head_commit.message, 'chore(release)')) }} steps: - - uses: actions/checkout@v2 + - name: Checkout repository + uses: actions/checkout@v2 with: - fetch-depth: 0 - token: ${{ secrets.USER_TOKEN }} + node-version: 16 - - uses: actions/setup-node@v2 + - name: Install Node.js + uses: actions/setup-node@v2 with: node-version: 16 - - name: Install node_modules run: yarn - - name: Authenticate with GitHub - run: | - git config --global user.name "${{ secrets.USER_NAME }}" - git config --global user.email "${{ secrets.USER_EMAIL }}" + - name: Generate Site + run: yarn generate + + - name: "Upload generated content" + uses: actions/upload-artifact@v2 + with: + name: starknet-site + if-no-files-found: error + path: + public_html + + publish: + name: deploy-review + runs-on: ubuntu-latest + needs: + - test-deploy + steps: + - name: Checkout repository + uses: actions/checkout@v2 + with: + node-version: 16 + ref: gh-pages + #USER_TOKEN: ${{ secrets.USER_TOKEN }} - - name: Run release script - if: ${{ github.ref_name == 'main' }} - run: yarn run release + - name: Extract PR details + id: pr + run: | + PR_ID=pr-${{ github.event.pull_request.number }} + PREVIEW_PATH=previews/${PR_ID} + echo "::set-output name=PR_ID::${PR_ID}" - - name: Push to remote branch - uses: ad-m/github-push-action@master + - name: "Remove preview build directory" + run: rm -rf ${{ steps.pr.outputs.PR_ID }} + - name: "Create preview build directory" + run: mkdir -p ${{ steps.pr.outputs.PR_ID }} + - name: "Download generated content" + uses: actions/download-artifact@v2 with: - USER_TOKEN: ${{ secrets.USER_TOKEN }} - branch: ${{ github.ref }} - tags: true - force: true + name: starknet-site + path: ${{ steps.pr.outputs.PR_ID }} + + - name: PR preview details + run: + echo "you can preview the PR at https://starknet-io.github.io/starknet-docs/${{ steps.pr.outputs.PR_ID }}/documentation/" + + - name: "Commit changes" + run: | + set -euo pipefail + + # Debug information + echo "Current directory: $(pwd)" + echo "Contents of the repository:" + ls -al + echo "Git status:" + git status + git config -l + + git add . + + + if ! git diff-index --quiet HEAD --; then + # Debug information + echo "Changes detected. Committing and pushing changes." + + commit_message="Adding or updating preview build for PR ${{ steps.pr.outputs.PR_ID }}" + + # Debug message + echo "Commit message: $commit_message" + + # Commit changes + git commit -m "$commit_message" + + # Check if commit was successful + if [ $? -eq 0 ]; then + # Debug information + echo "Commit successful. Pushing changes." + + # Push changes + git push --set-upstream origin gh-pages + + # Check if push was successful + if [ $? -eq 0 ]; then + # Debug information + echo "Push successful." + else + # Debug information + echo "Error: Push failed." + fi + else + # Debug information + echo "Error: Commit failed." + fi + else + # Debug information + echo "No changes found." + fi + env: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + + - name: "Send comment to PR" + continue-on-error: true + run: | + set -euo pipefail + echo "Your preview build is ready! ✨ Check the following link in 1-2 minutes: https://starknet-io.github.io/starknet-docs/${{ steps.pr.outputs.PR_ID }}/documentation/ ." >/tmp/comment + gh pr comment ${{ github.event.pull_request.number }} -F /tmp/comment + env: + # USER_TOKEN: "${{ secrets.USER_TOKEN }}" + GH_TOKEN: "${{ github.token }}" + From dd78a5b44ae4031ad98cc7c243f68652d7d3afae Mon Sep 17 00:00:00 2001 From: xiaolou86 <20718693+xiaolou86@users.noreply.github.com> Date: Sun, 4 Feb 2024 10:44:23 +0800 Subject: [PATCH 09/21] fix: generate previews from forked repos --- .github/workflows/pull_request.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 0f6fd726d2..0cbb6921c3 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -9,8 +9,8 @@ on: # branches: # - main -#permissions: -# contents: write +permissions: + contents: write jobs: @@ -135,6 +135,8 @@ jobs: fi env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + #GITHUB_TOKEN: "${{ secrets.USER_TOKEN }}" + #USER_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - name: "Send comment to PR" continue-on-error: true @@ -143,5 +145,6 @@ jobs: echo "Your preview build is ready! ✨ Check the following link in 1-2 minutes: https://starknet-io.github.io/starknet-docs/${{ steps.pr.outputs.PR_ID }}/documentation/ ." >/tmp/comment gh pr comment ${{ github.event.pull_request.number }} -F /tmp/comment env: - # USER_TOKEN: "${{ secrets.USER_TOKEN }}" - GH_TOKEN: "${{ github.token }}" + USER_TOKEN: "${{ secrets.USER_TOKEN }}" + #GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + #GH_TOKEN: "${{ github.token }}" From 2935c28bbe26bc4842c1bed9ab13a854799ebc01 Mon Sep 17 00:00:00 2001 From: xiaolou86 <20718693+xiaolou86@users.noreply.github.com> Date: Sun, 4 Feb 2024 10:48:02 +0800 Subject: [PATCH 10/21] fix: generate previews from forked repos --- .github/workflows/pull_request.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 0cbb6921c3..4d561bc7bd 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -93,6 +93,8 @@ jobs: echo "Git status:" git status git config -l + git config user.name "GitHub Actions" + git config user.email noreply@github.com git add . @@ -134,8 +136,8 @@ jobs: echo "No changes found." fi env: - GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - #GITHUB_TOKEN: "${{ secrets.USER_TOKEN }}" + #GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + GITHUB_TOKEN: "${{ secrets.USER_TOKEN }}" #USER_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - name: "Send comment to PR" From 8b4b14d337b2ab2eadbf8ce09293643863a3282f Mon Sep 17 00:00:00 2001 From: xiaolou86 <20718693+xiaolou86@users.noreply.github.com> Date: Sun, 4 Feb 2024 10:49:41 +0800 Subject: [PATCH 11/21] fix: generate previews from forked repos --- .github/workflows/pull_request.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 4d561bc7bd..06db5c31d9 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -137,8 +137,8 @@ jobs: fi env: #GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - GITHUB_TOKEN: "${{ secrets.USER_TOKEN }}" - #USER_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + #GITHUB_TOKEN: "${{ secrets.USER_TOKEN }}" + USER_TOKEN: "${{ secrets.USER_TOKEN }}" - name: "Send comment to PR" continue-on-error: true From ecbc9e188f031cb6ae921d6fee5bb80b0effd7c3 Mon Sep 17 00:00:00 2001 From: xiaolou86 <20718693+xiaolou86@users.noreply.github.com> Date: Sun, 4 Feb 2024 10:53:36 +0800 Subject: [PATCH 12/21] fix: generate previews from forked repos --- .github/workflows/pull_request.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 06db5c31d9..d99aa19c4b 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -10,6 +10,9 @@ on: # - main permissions: + pull-requests: write + issues: write + repository-projects: write contents: write From 9d3f47997155986c72e3f1d07d6057c769d96241 Mon Sep 17 00:00:00 2001 From: xiaolou86 <20718693+xiaolou86@users.noreply.github.com> Date: Sun, 4 Feb 2024 11:12:20 +0800 Subject: [PATCH 13/21] fix: generate previews from forked repos --- .github/workflows/pull_request.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index d99aa19c4b..c0a79521aa 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -62,6 +62,8 @@ jobs: with: node-version: 16 ref: gh-pages + persist-credentials: false + fetch-depth: 0 #USER_TOKEN: ${{ secrets.USER_TOKEN }} - name: Extract PR details From e763b483d6be517f0835d554e72464e15246c5c9 Mon Sep 17 00:00:00 2001 From: xiaolou86 <20718693+xiaolou86@users.noreply.github.com> Date: Sun, 4 Feb 2024 11:17:28 +0800 Subject: [PATCH 14/21] fix: generate previews from forked repos --- .github/workflows/pull_request.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index c0a79521aa..94575329e0 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -64,6 +64,7 @@ jobs: ref: gh-pages persist-credentials: false fetch-depth: 0 + token: ${{ secrets.USER_TOKEN }} #USER_TOKEN: ${{ secrets.USER_TOKEN }} - name: Extract PR details From 91fad6ba698724a8bd788af41643fcc7189386d6 Mon Sep 17 00:00:00 2001 From: xiaolou86 <20718693+xiaolou86@users.noreply.github.com> Date: Sun, 4 Feb 2024 11:21:37 +0800 Subject: [PATCH 15/21] fix: generate previews from forked repos --- .github/workflows/pull_request.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 94575329e0..66f02305cd 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -64,7 +64,8 @@ jobs: ref: gh-pages persist-credentials: false fetch-depth: 0 - token: ${{ secrets.USER_TOKEN }} + #token: ${{ secrets.USER_TOKEN }} //null + token: ${{ secrets.GITHUB_TOKEN }} #USER_TOKEN: ${{ secrets.USER_TOKEN }} - name: Extract PR details From 7cb733bda6c4c31d49d2cdc762ffb1086d00a0b8 Mon Sep 17 00:00:00 2001 From: xiaolou86 <20718693+xiaolou86@users.noreply.github.com> Date: Sun, 4 Feb 2024 11:27:55 +0800 Subject: [PATCH 16/21] fix: generate previews from forked repos --- .github/workflows/pull_request.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 66f02305cd..dd7bb57cd0 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -117,6 +117,10 @@ jobs: # Commit changes git commit -m "$commit_message" + + git remote -v + git branch + git branch -a # Check if commit was successful if [ $? -eq 0 ]; then From ee6b3152b337ce340fac357b1c4dda375d691c55 Mon Sep 17 00:00:00 2001 From: xiaolou86 <20718693+xiaolou86@users.noreply.github.com> Date: Mon, 5 Feb 2024 11:14:59 +0800 Subject: [PATCH 17/21] fix: generate previews from forked repos --- .github/workflows/pull_request.yml | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index dd7bb57cd0..fb20b853a9 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -60,13 +60,8 @@ jobs: - name: Checkout repository uses: actions/checkout@v2 with: - node-version: 16 ref: gh-pages - persist-credentials: false - fetch-depth: 0 - #token: ${{ secrets.USER_TOKEN }} //null token: ${{ secrets.GITHUB_TOKEN }} - #USER_TOKEN: ${{ secrets.USER_TOKEN }} - name: Extract PR details id: pr @@ -118,10 +113,6 @@ jobs: # Commit changes git commit -m "$commit_message" - git remote -v - git branch - git branch -a - # Check if commit was successful if [ $? -eq 0 ]; then # Debug information @@ -147,9 +138,7 @@ jobs: echo "No changes found." fi env: - #GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - #GITHUB_TOKEN: "${{ secrets.USER_TOKEN }}" - USER_TOKEN: "${{ secrets.USER_TOKEN }}" + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - name: "Send comment to PR" continue-on-error: true @@ -158,6 +147,4 @@ jobs: echo "Your preview build is ready! ✨ Check the following link in 1-2 minutes: https://starknet-io.github.io/starknet-docs/${{ steps.pr.outputs.PR_ID }}/documentation/ ." >/tmp/comment gh pr comment ${{ github.event.pull_request.number }} -F /tmp/comment env: - USER_TOKEN: "${{ secrets.USER_TOKEN }}" - #GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - #GH_TOKEN: "${{ github.token }}" + GH_TOKEN: "${{ github.token }}" From e7dc111e328e1ca65f8b4c1d7f6b82f39215d38b Mon Sep 17 00:00:00 2001 From: xiaolou86 <20718693+xiaolou86@users.noreply.github.com> Date: Mon, 5 Feb 2024 11:23:04 +0800 Subject: [PATCH 18/21] fix: generate previews from forked repos --- .github/workflows/pull_request.yml | 14 +-- .github/workflows/push.yml | 138 +++++------------------------ 2 files changed, 27 insertions(+), 125 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index fb20b853a9..2d4af217af 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -3,19 +3,12 @@ name: Pull request workflow on: pull_request: branches: - - '*' - -# push: -# branches: -# - main + - 'main' + - 'dev' permissions: - pull-requests: write - issues: write - repository-projects: write contents: write - jobs: typos: @@ -31,7 +24,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v2 with: - node-version: 16 + ref: refs/pull/${{ github.event.pull_request.number }}/merge - name: Install Node.js uses: actions/setup-node@v2 @@ -94,7 +87,6 @@ jobs: ls -al echo "Git status:" git status - git config -l git config user.name "GitHub Actions" git config user.email noreply@github.com diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index b502361ea9..698c07f230 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -2,131 +2,41 @@ name: Push workflow on: push: + branches: +# - dev + - main jobs: - - test-deploy: - name: Test deploy + release-version: + name: Releasing a version runs-on: ubuntu-latest + if: ${{ !contains(github.event.head_commit.message, 'chore') || (github.ref_name == 'main' && !contains(github.event.head_commit.message, 'chore(release)')) }} steps: - - name: Checkout repository - uses: actions/checkout@v2 + - uses: actions/checkout@v2 with: - node-version: 16 + fetch-depth: 0 + token: ${{ secrets.USER_TOKEN }} - - name: Install Node.js - uses: actions/setup-node@v2 + - uses: actions/setup-node@v2 with: node-version: 16 + - name: Install node_modules run: yarn - - name: Generate Site - run: yarn generate - - - name: "Upload generated content" - uses: actions/upload-artifact@v2 - with: - name: starknet-site - if-no-files-found: error - path: - public_html - - publish: - name: deploy-review - runs-on: ubuntu-latest - needs: - - test-deploy - steps: - - name: Checkout repository - uses: actions/checkout@v2 - with: - node-version: 16 - ref: gh-pages - #USER_TOKEN: ${{ secrets.USER_TOKEN }} - - - name: Extract PR details - id: pr - run: | - PR_ID=pr-${{ github.event.pull_request.number }} - PREVIEW_PATH=previews/${PR_ID} - echo "::set-output name=PR_ID::${PR_ID}" - - - name: "Remove preview build directory" - run: rm -rf ${{ steps.pr.outputs.PR_ID }} - - name: "Create preview build directory" - run: mkdir -p ${{ steps.pr.outputs.PR_ID }} - - name: "Download generated content" - uses: actions/download-artifact@v2 - with: - name: starknet-site - path: ${{ steps.pr.outputs.PR_ID }} - - - name: PR preview details - run: - echo "you can preview the PR at https://starknet-io.github.io/starknet-docs/${{ steps.pr.outputs.PR_ID }}/documentation/" - - - name: "Commit changes" + - name: Authenticate with GitHub run: | - set -euo pipefail - - # Debug information - echo "Current directory: $(pwd)" - echo "Contents of the repository:" - ls -al - echo "Git status:" - git status - git config -l - - git add . - - - if ! git diff-index --quiet HEAD --; then - # Debug information - echo "Changes detected. Committing and pushing changes." + git config --global user.name "${{ secrets.USER_NAME }}" + git config --global user.email "${{ secrets.USER_EMAIL }}" - commit_message="Adding or updating preview build for PR ${{ steps.pr.outputs.PR_ID }}" - - # Debug message - echo "Commit message: $commit_message" - - # Commit changes - git commit -m "$commit_message" - - # Check if commit was successful - if [ $? -eq 0 ]; then - # Debug information - echo "Commit successful. Pushing changes." - - # Push changes - git push --set-upstream origin gh-pages - - # Check if push was successful - if [ $? -eq 0 ]; then - # Debug information - echo "Push successful." - else - # Debug information - echo "Error: Push failed." - fi - else - # Debug information - echo "Error: Commit failed." - fi - else - # Debug information - echo "No changes found." - fi - env: - GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - - - name: "Send comment to PR" - continue-on-error: true - run: | - set -euo pipefail - echo "Your preview build is ready! ✨ Check the following link in 1-2 minutes: https://starknet-io.github.io/starknet-docs/${{ steps.pr.outputs.PR_ID }}/documentation/ ." >/tmp/comment - gh pr comment ${{ github.event.pull_request.number }} -F /tmp/comment - env: - # USER_TOKEN: "${{ secrets.USER_TOKEN }}" - GH_TOKEN: "${{ github.token }}" + - name: Run release script + if: ${{ github.ref_name == 'main' }} + run: yarn run release + - name: Push to remote branch + uses: ad-m/github-push-action@master + with: + USER_TOKEN: ${{ secrets.USER_TOKEN }} + branch: ${{ github.ref }} + tags: true + force: true From 7bd7e47fefea028a7720d9089604660839879d0f Mon Sep 17 00:00:00 2001 From: xiaolou86 <20718693+xiaolou86@users.noreply.github.com> Date: Mon, 5 Feb 2024 11:27:50 +0800 Subject: [PATCH 19/21] fix: typo --- .../pages/Smart_Contracts/serialization_of_Cairo_types.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/Starknet/modules/architecture_and_concepts/pages/Smart_Contracts/serialization_of_Cairo_types.adoc b/components/Starknet/modules/architecture_and_concepts/pages/Smart_Contracts/serialization_of_Cairo_types.adoc index 7f21152447..b30874cc75 100644 --- a/components/Starknet/modules/architecture_and_concepts/pages/Smart_Contracts/serialization_of_Cairo_types.adoc +++ b/components/Starknet/modules/architecture_and_concepts/pages/Smart_Contracts/serialization_of_Cairo_types.adoc @@ -1,7 +1,7 @@ [id="serialization_of_types_in_Cairo"] = Serialization of Cairo types -When you interact with contracts, especially if you are a library or SDK developer that wants to construt transactions, you need to understand how Cairo handles types that are larger than 252 bits so you can correctly formulate the calldata in a transaction. +When you interact with contracts, especially if you are a library or SDK developer that wants to construct transactions, you need to understand how Cairo handles types that are larger than 252 bits so you can correctly formulate the calldata in a transaction. The field element (`felt252`), which contains 252 bits, is the only actual type in the Cairo VM. So all high-level Cairo types that are larger than 252 bits, such as `u256` or arrays, are ultimately represented by a list of felts. In order to interact with a contract, you need to know how to encode its arguments as a list of felts so you can correctly formulate the calldata in the transaction. SDKs, such as starknet.js, encode the calldata for you, so you can simply specify any type and the SDK properly formulates the calldata. For example, you don’t need to know that a `u256` value is represented by two `felt252` values. You can simply specify a single integer in your code, and the SDK takes care of the serialization and encoding. From 2475e854c18cf97ae92d97b1bd1ab772cc9f631c Mon Sep 17 00:00:00 2001 From: xiaolou86 <20718693+xiaolou86@users.noreply.github.com> Date: Mon, 5 Feb 2024 11:32:11 +0800 Subject: [PATCH 20/21] fix: generate previews from forked repos --- .github/workflows/pull_request.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 2d4af217af..12ed8cd762 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -2,6 +2,10 @@ name: Pull request workflow on: pull_request: + types: + - opened + - reopened + - synchronize branches: - 'main' - 'dev' From aa552d8bd26ba703074fe0d800e56f25978e163f Mon Sep 17 00:00:00 2001 From: xiaolou86 <20718693+xiaolou86@users.noreply.github.com> Date: Mon, 5 Feb 2024 11:32:58 +0800 Subject: [PATCH 21/21] fix: generate previews from forked repos --- .github/workflows/pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 12ed8cd762..14eee96be3 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -1,7 +1,7 @@ name: Pull request workflow on: - pull_request: + pull_request_target: types: - opened - reopened