From 094d705aa1d1d1a67219142c573de2d341bba867 Mon Sep 17 00:00:00 2001 From: Raymond Sukanto Date: Thu, 30 Jan 2025 18:00:11 -0500 Subject: [PATCH 1/7] update markdown md fix --- .github/workflows/update-markdown.yml | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/update-markdown.yml b/.github/workflows/update-markdown.yml index 7f274f305..c2daab029 100644 --- a/.github/workflows/update-markdown.yml +++ b/.github/workflows/update-markdown.yml @@ -53,14 +53,16 @@ jobs: run: | python .github/scripts/sdk_doc.py - - name: Commit files - uses: ChromeQ/commit@v2.0.0 - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - files: | - cmd/commands.md - sdk/SDK.md - commit-message: "chore: Update MD files [skip ci]" - ref: ${{ github.head_ref }} + - name: Check for changes + id: check_changes + run: | + git diff --exit-code || echo "changes=true" >> $GITHUB_ENV + - name: Commit changes to PR branch + if: env.changes == 'true' + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + git add cmd/commands.md sdk/SDK.md + git commit --amend --no-edit || echo "No changes to amend" + git push --force \ No newline at end of file From 5925fd02610881f3fd896d22e4f56192f0e4a383 Mon Sep 17 00:00:00 2001 From: Raymond Sukanto Date: Thu, 30 Jan 2025 18:01:57 -0500 Subject: [PATCH 2/7] update flag --- cmd/blockchaincmd/create.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/blockchaincmd/create.go b/cmd/blockchaincmd/create.go index 948d89bd0..7ff853777 100644 --- a/cmd/blockchaincmd/create.go +++ b/cmd/blockchaincmd/create.go @@ -110,7 +110,7 @@ configuration, pass the -f flag.`, cmd.Flags().StringVar(&customVMRepoURL, "custom-vm-repo-url", "", "custom vm repository url") cmd.Flags().StringVar(&customVMBranch, "custom-vm-branch", "", "custom vm branch or commit") cmd.Flags().StringVar(&customVMBuildScript, "custom-vm-build-script", "", "custom vm build-script") - cmd.Flags().BoolVar(&useRepo, "from-github-repo", false, "generate custom VM binary from github repository") + cmd.Flags().BoolVar(&useRepo, "from-github-repos", false, "generate custom VM binary from github repository") cmd.Flags().BoolVar(&createFlags.useWarp, "warp", true, "generate a vm with warp support (needed for ICM)") cmd.Flags().BoolVar(&createFlags.useICM, "teleporter", false, "interoperate with other blockchains using ICM") cmd.Flags().BoolVar(&createFlags.useICM, "icm", false, "interoperate with other blockchains using ICM") From b24f7cc2928afbfbedc9f01aeb9ee9e525ddd653 Mon Sep 17 00:00:00 2001 From: Raymond Sukanto Date: Thu, 30 Jan 2025 18:01:57 -0500 Subject: [PATCH 3/7] update flag --- cmd/blockchaincmd/create.go | 2 +- cmd/commands.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/blockchaincmd/create.go b/cmd/blockchaincmd/create.go index 948d89bd0..7ff853777 100644 --- a/cmd/blockchaincmd/create.go +++ b/cmd/blockchaincmd/create.go @@ -110,7 +110,7 @@ configuration, pass the -f flag.`, cmd.Flags().StringVar(&customVMRepoURL, "custom-vm-repo-url", "", "custom vm repository url") cmd.Flags().StringVar(&customVMBranch, "custom-vm-branch", "", "custom vm branch or commit") cmd.Flags().StringVar(&customVMBuildScript, "custom-vm-build-script", "", "custom vm build-script") - cmd.Flags().BoolVar(&useRepo, "from-github-repo", false, "generate custom VM binary from github repository") + cmd.Flags().BoolVar(&useRepo, "from-github-repos", false, "generate custom VM binary from github repository") cmd.Flags().BoolVar(&createFlags.useWarp, "warp", true, "generate a vm with warp support (needed for ICM)") cmd.Flags().BoolVar(&createFlags.useICM, "teleporter", false, "interoperate with other blockchains using ICM") cmd.Flags().BoolVar(&createFlags.useICM, "icm", false, "interoperate with other blockchains using ICM") diff --git a/cmd/commands.md b/cmd/commands.md index 8dca1bac5..cd12cb393 100644 --- a/cmd/commands.md +++ b/cmd/commands.md @@ -299,7 +299,7 @@ avalanche blockchain create [subcommand] [flags] --evm-token string token symbol to use with Subnet-EVM --external-gas-token use a gas token from another blockchain -f, --force overwrite the existing configuration if one exists ---from-github-repo generate custom VM binary from github repository +--from-github-repos generate custom VM binary from github repository --genesis string file path of genesis to use -h, --help help for create --icm interoperate with other blockchains using ICM From 9372f8b677d581f659855d24cff16551a81c19b0 Mon Sep 17 00:00:00 2001 From: Raymond Sukanto Date: Thu, 30 Jan 2025 18:13:12 -0500 Subject: [PATCH 4/7] test changes --- .github/workflows/update-markdown.yml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/update-markdown.yml b/.github/workflows/update-markdown.yml index c2daab029..45c682f25 100644 --- a/.github/workflows/update-markdown.yml +++ b/.github/workflows/update-markdown.yml @@ -53,16 +53,22 @@ jobs: run: | python .github/scripts/sdk_doc.py - - name: Check for changes + - name: Check if there are changes id: check_changes run: | - git diff --exit-code || echo "changes=true" >> $GITHUB_ENV + if git diff --quiet; then + echo "No changes detected." + echo "changes=false" >> $GITHUB_ENV + else + echo "Changes detected." + echo "changes=true" >> $GITHUB_ENV + fi - - name: Commit changes to PR branch + - name: Commit changes directly to PR branch if: env.changes == 'true' run: | git config --global user.name "github-actions[bot]" git config --global user.email "github-actions[bot]@users.noreply.github.com" git add cmd/commands.md sdk/SDK.md - git commit --amend --no-edit || echo "No changes to amend" - git push --force \ No newline at end of file + git commit -m "chore: Update MD files" + git push From de90d77ba6b5e10fe5df3e251c1cc0f6c5628b25 Mon Sep 17 00:00:00 2001 From: Raymond Sukanto Date: Thu, 30 Jan 2025 18:15:56 -0500 Subject: [PATCH 5/7] test changes --- .github/workflows/update-markdown.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/update-markdown.yml b/.github/workflows/update-markdown.yml index 45c682f25..5b4226703 100644 --- a/.github/workflows/update-markdown.yml +++ b/.github/workflows/update-markdown.yml @@ -1,15 +1,13 @@ name: Update Markdown on: - push: - branches: - - main - pull_request: - branches: - - main + pull_request_review: + types: + - submitted jobs: update-md: + if: github.event.review.state == 'approved' runs-on: ubuntu-latest steps: @@ -40,8 +38,6 @@ jobs: - name: Install dependencies run: | pip install --upgrade pip - # If you need additional dependencies, install them here - # pip install -r requirements.txt - name: Generate CLI MD id: generate_cli_md From 91a283e3f4546538765cc6d8c0260cfe0cd039bb Mon Sep 17 00:00:00 2001 From: Raymond Sukanto Date: Thu, 30 Jan 2025 18:16:18 -0500 Subject: [PATCH 6/7] undo chan ge --- cmd/blockchaincmd/create.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/blockchaincmd/create.go b/cmd/blockchaincmd/create.go index 7ff853777..948d89bd0 100644 --- a/cmd/blockchaincmd/create.go +++ b/cmd/blockchaincmd/create.go @@ -110,7 +110,7 @@ configuration, pass the -f flag.`, cmd.Flags().StringVar(&customVMRepoURL, "custom-vm-repo-url", "", "custom vm repository url") cmd.Flags().StringVar(&customVMBranch, "custom-vm-branch", "", "custom vm branch or commit") cmd.Flags().StringVar(&customVMBuildScript, "custom-vm-build-script", "", "custom vm build-script") - cmd.Flags().BoolVar(&useRepo, "from-github-repos", false, "generate custom VM binary from github repository") + cmd.Flags().BoolVar(&useRepo, "from-github-repo", false, "generate custom VM binary from github repository") cmd.Flags().BoolVar(&createFlags.useWarp, "warp", true, "generate a vm with warp support (needed for ICM)") cmd.Flags().BoolVar(&createFlags.useICM, "teleporter", false, "interoperate with other blockchains using ICM") cmd.Flags().BoolVar(&createFlags.useICM, "icm", false, "interoperate with other blockchains using ICM") From 408fbf1aa8643021b22f621d3d38c2cf65f93eb0 Mon Sep 17 00:00:00 2001 From: Raymond Sukanto Date: Thu, 30 Jan 2025 18:29:39 -0500 Subject: [PATCH 7/7] update ci --- .github/workflows/update-markdown.yml | 32 ++++++++++----------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/.github/workflows/update-markdown.yml b/.github/workflows/update-markdown.yml index 5b4226703..ef7d6e451 100644 --- a/.github/workflows/update-markdown.yml +++ b/.github/workflows/update-markdown.yml @@ -1,17 +1,15 @@ name: Update Markdown on: - pull_request_review: - types: - - submitted + pull_request: + types: [approved] # Runs only when the PR is approved jobs: update-md: - if: github.event.review.state == 'approved' runs-on: ubuntu-latest steps: - - name: Check out the repo + - name: Check out the repo on the PR branch uses: actions/checkout@v3 with: ref: ${{ github.head_ref }} @@ -38,6 +36,8 @@ jobs: - name: Install dependencies run: | pip install --upgrade pip + # Add any other dependencies if required + # pip install -r requirements.txt - name: Generate CLI MD id: generate_cli_md @@ -49,22 +49,14 @@ jobs: run: | python .github/scripts/sdk_doc.py - - name: Check if there are changes - id: check_changes - run: | - if git diff --quiet; then - echo "No changes detected." - echo "changes=false" >> $GITHUB_ENV - else - echo "Changes detected." - echo "changes=true" >> $GITHUB_ENV - fi - - - name: Commit changes directly to PR branch - if: env.changes == 'true' + - name: Commit and push changes to the PR branch run: | git config --global user.name "github-actions[bot]" git config --global user.email "github-actions[bot]@users.noreply.github.com" + + git checkout ${{ github.head_ref }} # Ensure we're on the PR branch + git add cmd/commands.md sdk/SDK.md - git commit -m "chore: Update MD files" - git push + git commit -m "chore: Update MD files" || echo "No changes to commit" + + git push origin ${{ github.head_ref }}