From b8205fdbfbc97af701a42bd7d236fdd496bf5c6e Mon Sep 17 00:00:00 2001 From: in-incognito Date: Wed, 21 Aug 2024 12:13:48 +0800 Subject: [PATCH 01/14] edit update-token-list.yml to allow editing --- .github/workflows/update-token-list.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/update-token-list.yml b/.github/workflows/update-token-list.yml index 47e6d03..a11a9ef 100644 --- a/.github/workflows/update-token-list.yml +++ b/.github/workflows/update-token-list.yml @@ -129,6 +129,15 @@ jobs: run: | jq --indent 4 . FXList.json > tmp.FXList.json && mv tmp.FXList.json FXList.json + - name: Check if branch exists + run: | + if git show-ref --quiet refs/heads/${{ env.branch_name }}; then + echo "Branch exists. Deleting branch ${{ env.branch_name }}." + git branch -D ${{ env.branch_name }} + else + echo "Branch does not exist. Proceeding to create a new branch." + fi + - name: Commit changes run: | git checkout -b ${{ env.branch_name }} From 74d8c91fbcaae665d619d6a78552ae5dd60cc43e Mon Sep 17 00:00:00 2001 From: in-incognito Date: Wed, 21 Aug 2024 12:18:39 +0800 Subject: [PATCH 02/14] edit update-token-list.yml to allow editing --- .github/workflows/update-token-list.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/update-token-list.yml b/.github/workflows/update-token-list.yml index a11a9ef..a1fc40e 100644 --- a/.github/workflows/update-token-list.yml +++ b/.github/workflows/update-token-list.yml @@ -129,13 +129,22 @@ jobs: run: | jq --indent 4 . FXList.json > tmp.FXList.json && mv tmp.FXList.json FXList.json - - name: Check if branch exists + - name: Check if branch exists locally and delete if it does run: | if git show-ref --quiet refs/heads/${{ env.branch_name }}; then - echo "Branch exists. Deleting branch ${{ env.branch_name }}." + echo "Branch exists locally. Deleting local branch ${{ env.branch_name }}." git branch -D ${{ env.branch_name }} else - echo "Branch does not exist. Proceeding to create a new branch." + echo "Branch does not exist locally." + fi + + - name: Check if branch exists remotely and delete if it does + run: | + if git ls-remote --exit-code --heads origin ${{ env.branch_name }}; then + echo "Branch exists remotely. Deleting remote branch ${{ env.branch_name }}." + git push origin --delete ${{ env.branch_name }} + else + echo "Branch does not exist remotely." fi - name: Commit changes From 6cd4e872e35256e81a9ce568d13b27eef9d6b7d9 Mon Sep 17 00:00:00 2001 From: in-incognito Date: Wed, 21 Aug 2024 12:24:27 +0800 Subject: [PATCH 03/14] edit update-token-list.yml to allow editing --- .github/workflows/update-token-list.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/update-token-list.yml b/.github/workflows/update-token-list.yml index a1fc40e..14bc6be 100644 --- a/.github/workflows/update-token-list.yml +++ b/.github/workflows/update-token-list.yml @@ -147,10 +147,14 @@ jobs: echo "Branch does not exist remotely." fi + - name: Remove workflows folder + run: | + git rm -r .github/workflows + git commit -m "Remove workflows directory" + - name: Commit changes run: | git checkout -b ${{ env.branch_name }} - git rm -r .github/workflows git add FXList.json Tokens/${{ github.event.inputs.address }}/${{ env.logo_filename }} git commit -m "Add token ${{ github.event.inputs.address }} ${{ github.event.inputs.name }} (${{ github.event.inputs.symbol }})" git push origin ${{ env.branch_name }} From 3409278decc2ef704d14c517a4164ade5edffe17 Mon Sep 17 00:00:00 2001 From: in-incognito Date: Wed, 21 Aug 2024 13:33:37 +0800 Subject: [PATCH 04/14] edit update-token-list.yml to allow editing --- .github/workflows/update-token-list.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/update-token-list.yml b/.github/workflows/update-token-list.yml index 14bc6be..f12c91c 100644 --- a/.github/workflows/update-token-list.yml +++ b/.github/workflows/update-token-list.yml @@ -149,7 +149,8 @@ jobs: - name: Remove workflows folder run: | - git rm -r .github/workflows + git rm -r --cached .github/workflows + rm -rf .github/workflows git commit -m "Remove workflows directory" - name: Commit changes From 773bf0829065ecb0c1b0a07b75cd9649486b0210 Mon Sep 17 00:00:00 2001 From: in-incognito Date: Wed, 21 Aug 2024 13:40:54 +0800 Subject: [PATCH 05/14] edit update-token-list.yml to allow editing --- .github/workflows/update-token-list.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/update-token-list.yml b/.github/workflows/update-token-list.yml index f12c91c..a1fc40e 100644 --- a/.github/workflows/update-token-list.yml +++ b/.github/workflows/update-token-list.yml @@ -147,15 +147,10 @@ jobs: echo "Branch does not exist remotely." fi - - name: Remove workflows folder - run: | - git rm -r --cached .github/workflows - rm -rf .github/workflows - git commit -m "Remove workflows directory" - - name: Commit changes run: | git checkout -b ${{ env.branch_name }} + git rm -r .github/workflows git add FXList.json Tokens/${{ github.event.inputs.address }}/${{ env.logo_filename }} git commit -m "Add token ${{ github.event.inputs.address }} ${{ github.event.inputs.name }} (${{ github.event.inputs.symbol }})" git push origin ${{ env.branch_name }} From 388dbd5d015e1158a72c5c79826b106b13f85794 Mon Sep 17 00:00:00 2001 From: in-incognito Date: Wed, 21 Aug 2024 13:56:30 +0800 Subject: [PATCH 06/14] restore update-token-list.yml --- .github/workflows/update-token-list.yml | 32 ++++++++++++------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/update-token-list.yml b/.github/workflows/update-token-list.yml index a1fc40e..ce1723f 100644 --- a/.github/workflows/update-token-list.yml +++ b/.github/workflows/update-token-list.yml @@ -129,22 +129,22 @@ jobs: run: | jq --indent 4 . FXList.json > tmp.FXList.json && mv tmp.FXList.json FXList.json - - name: Check if branch exists locally and delete if it does - run: | - if git show-ref --quiet refs/heads/${{ env.branch_name }}; then - echo "Branch exists locally. Deleting local branch ${{ env.branch_name }}." - git branch -D ${{ env.branch_name }} - else - echo "Branch does not exist locally." - fi - - - name: Check if branch exists remotely and delete if it does - run: | - if git ls-remote --exit-code --heads origin ${{ env.branch_name }}; then - echo "Branch exists remotely. Deleting remote branch ${{ env.branch_name }}." - git push origin --delete ${{ env.branch_name }} - else - echo "Branch does not exist remotely." + # - name: Check if branch exists locally and delete if it does + # run: | + # if git show-ref --quiet refs/heads/${{ env.branch_name }}; then + # echo "Branch exists locally. Deleting local branch ${{ env.branch_name }}." + # git branch -D ${{ env.branch_name }} + # else + # echo "Branch does not exist locally." + # fi + + # - name: Check if branch exists remotely and delete if it does + # run: | + # if git ls-remote --exit-code --heads origin ${{ env.branch_name }}; then + # echo "Branch exists remotely. Deleting remote branch ${{ env.branch_name }}." + # git push origin --delete ${{ env.branch_name }} + # else + # echo "Branch does not exist remotely." fi - name: Commit changes From f504cf59a5883bdb7c55c1d0d276fa1408058b90 Mon Sep 17 00:00:00 2001 From: in-incognito Date: Wed, 21 Aug 2024 14:05:25 +0800 Subject: [PATCH 07/14] ammend sync-with-upstream.yml --- .github/workflows/sync-with-upstream.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/sync-with-upstream.yml b/.github/workflows/sync-with-upstream.yml index afb1800..d6ebdee 100644 --- a/.github/workflows/sync-with-upstream.yml +++ b/.github/workflows/sync-with-upstream.yml @@ -41,11 +41,13 @@ jobs: - name: Merge Upstream Changes if: env.changes == 'true' run: | - git merge upstream/main + git merge -X ours --no-commit upstream/main + git checkout HEAD -- .github/workflows + git commit -m "Merge upstream changes while keeping forked workflows" - - name: Pull Latest Changes from Origin - if: env.changes == 'true' - run: git pull origin main + # - name: Pull Latest Changes from Origin + # if: env.changes == 'true' + # run: git pull origin main - name: Push Changes if: env.changes == 'true' From 535df0d998c11844825d6bffa088dfcf71ed880e Mon Sep 17 00:00:00 2001 From: in-incognito Date: Wed, 21 Aug 2024 14:06:04 +0800 Subject: [PATCH 08/14] ammend sync-with-upstream.yml --- .github/workflows/update-token-list.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-token-list.yml b/.github/workflows/update-token-list.yml index ce1723f..6d46b00 100644 --- a/.github/workflows/update-token-list.yml +++ b/.github/workflows/update-token-list.yml @@ -145,7 +145,7 @@ jobs: # git push origin --delete ${{ env.branch_name }} # else # echo "Branch does not exist remotely." - fi + # fi - name: Commit changes run: | From 84e73c875548574f7317de0a400334e96b3368ab Mon Sep 17 00:00:00 2001 From: in-incognito Date: Wed, 21 Aug 2024 14:07:41 +0800 Subject: [PATCH 09/14] ammend sync-with-upstream.yml --- .github/workflows/sync-with-upstream.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sync-with-upstream.yml b/.github/workflows/sync-with-upstream.yml index d6ebdee..8fa5359 100644 --- a/.github/workflows/sync-with-upstream.yml +++ b/.github/workflows/sync-with-upstream.yml @@ -41,8 +41,10 @@ jobs: - name: Merge Upstream Changes if: env.changes == 'true' run: | - git merge -X ours --no-commit upstream/main - git checkout HEAD -- .github/workflows + git merge -X ours --no-commit upstream/main || true + # Keep your versions of the workflows if they exist and were deleted upstream + git checkout --ours .github/workflows/ + git add .github/workflows/ git commit -m "Merge upstream changes while keeping forked workflows" # - name: Pull Latest Changes from Origin From 25af32205691dbef872d2287585130fa9e069607 Mon Sep 17 00:00:00 2001 From: in-incognito Date: Wed, 21 Aug 2024 14:10:39 +0800 Subject: [PATCH 10/14] ammend sync-with-upstream.yml --- .github/workflows/sync-with-upstream.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/sync-with-upstream.yml b/.github/workflows/sync-with-upstream.yml index 8fa5359..3c2e745 100644 --- a/.github/workflows/sync-with-upstream.yml +++ b/.github/workflows/sync-with-upstream.yml @@ -38,14 +38,18 @@ jobs: echo "changes=true" >> $GITHUB_ENV fi - - name: Merge Upstream Changes + - name: Merge Upstream Changes and Preserve All Workflows if: env.changes == 'true' run: | git merge -X ours --no-commit upstream/main || true - # Keep your versions of the workflows if they exist and were deleted upstream - git checkout --ours .github/workflows/ + # Ensure all workflow files are preserved + for file in .github/workflows/*; do + if [ -e "$file" ]; then + git checkout --ours "$file" + fi + done git add .github/workflows/ - git commit -m "Merge upstream changes while keeping forked workflows" + git commit -m "Merge upstream changes while keeping all forked workflows" # - name: Pull Latest Changes from Origin # if: env.changes == 'true' From fe101bc0eaf9f7f379bf8e41673ae0205fb3f269 Mon Sep 17 00:00:00 2001 From: in-incognito Date: Wed, 21 Aug 2024 14:18:55 +0800 Subject: [PATCH 11/14] ammend sync-with-upstream.yml --- .github/workflows/cleanup-branches.yml | 34 ++++++++++++++++++++++++ .github/workflows/sync-with-upstream.yml | 6 ++--- 2 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/cleanup-branches.yml diff --git a/.github/workflows/cleanup-branches.yml b/.github/workflows/cleanup-branches.yml new file mode 100644 index 0000000..fe10747 --- /dev/null +++ b/.github/workflows/cleanup-branches.yml @@ -0,0 +1,34 @@ +name: Cleanup Stale Branches + +on: + schedule: + # Runs at 00:00 every day + - cron: "0 0 * * *" + workflow_dispatch: + +jobs: + delete_old_branches: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Fetch all branches + run: git fetch --all + + - name: Delete stale branches + run: | + # Get the date 7 days ago in YYYY-MM-DD format + seven_days_ago=$(date -d '7 days ago' +%Y-%m-%d) + + # List branches that haven't been updated in the last 7 days + for branch in $(git for-each-ref --format='%(refname:short) %(committerdate:short)' refs/remotes/origin | awk -v date="$seven_days_ago" '$2 <= date {print $1}'); do + # Ensure the branch is not 'main', 'master', or any protected branches + if [[ "$branch" != "origin/main" && "$branch" != "origin/master" && "$branch" != *"HEAD"* ]]; then + git push origin --delete ${branch#origin/} + echo "Deleted branch $branch" + fi + done + + - name: Cleanup + run: git remote prune origin diff --git a/.github/workflows/sync-with-upstream.yml b/.github/workflows/sync-with-upstream.yml index 3c2e745..11203cb 100644 --- a/.github/workflows/sync-with-upstream.yml +++ b/.github/workflows/sync-with-upstream.yml @@ -51,9 +51,9 @@ jobs: git add .github/workflows/ git commit -m "Merge upstream changes while keeping all forked workflows" - # - name: Pull Latest Changes from Origin - # if: env.changes == 'true' - # run: git pull origin main + - name: Pull Latest Changes from Origin + if: env.changes == 'true' + run: git pull origin main --rebase - name: Push Changes if: env.changes == 'true' From 2a1f6a0dc076bb0b9a709df9e663d720e07c0d74 Mon Sep 17 00:00:00 2001 From: in-incognito Date: Wed, 21 Aug 2024 14:26:48 +0800 Subject: [PATCH 12/14] ammend update-token-list.yml --- .github/workflows/update-token-list.yml | 40 ++++++++++++++----------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/.github/workflows/update-token-list.yml b/.github/workflows/update-token-list.yml index 6d46b00..4ed76cb 100644 --- a/.github/workflows/update-token-list.yml +++ b/.github/workflows/update-token-list.yml @@ -96,6 +96,11 @@ jobs: # Save branch name to be used in subsequent steps echo "branch_name=$branch_name" >> $GITHUB_ENV + - name: Pull latest changes from main + run: | + git checkout main + git pull origin main + - name: Print branch name run: | echo "Branch name: ${{ env.branch_name }}" @@ -129,23 +134,23 @@ jobs: run: | jq --indent 4 . FXList.json > tmp.FXList.json && mv tmp.FXList.json FXList.json - # - name: Check if branch exists locally and delete if it does - # run: | - # if git show-ref --quiet refs/heads/${{ env.branch_name }}; then - # echo "Branch exists locally. Deleting local branch ${{ env.branch_name }}." - # git branch -D ${{ env.branch_name }} - # else - # echo "Branch does not exist locally." - # fi - - # - name: Check if branch exists remotely and delete if it does - # run: | - # if git ls-remote --exit-code --heads origin ${{ env.branch_name }}; then - # echo "Branch exists remotely. Deleting remote branch ${{ env.branch_name }}." - # git push origin --delete ${{ env.branch_name }} - # else - # echo "Branch does not exist remotely." - # fi + - name: Check if branch exists locally and delete if it does + run: | + if git show-ref --quiet refs/heads/${{ env.branch_name }}; then + echo "Branch exists locally. Deleting local branch ${{ env.branch_name }}." + git branch -D ${{ env.branch_name }} + else + echo "Branch does not exist locally." + fi + + - name: Check if branch exists remotely and delete if it does + run: | + if git ls-remote --exit-code --heads origin ${{ env.branch_name }}; then + echo "Branch exists remotely. Deleting remote branch ${{ env.branch_name }}." + git push origin --delete ${{ env.branch_name }} + else + echo "Branch does not exist remotely." + fi - name: Commit changes run: | @@ -153,6 +158,7 @@ jobs: git rm -r .github/workflows git add FXList.json Tokens/${{ github.event.inputs.address }}/${{ env.logo_filename }} git commit -m "Add token ${{ github.event.inputs.address }} ${{ github.event.inputs.name }} (${{ github.event.inputs.symbol }})" + git pull origin main --rebase git push origin ${{ env.branch_name }} - name: Install GitHub CLI From a2229b1c5cc16386e2a214dcbf94579b52c17c05 Mon Sep 17 00:00:00 2001 From: in-incognito Date: Wed, 21 Aug 2024 14:27:15 +0800 Subject: [PATCH 13/14] ammend update-token-list.yml --- .github/workflows/update-token-list.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-token-list.yml b/.github/workflows/update-token-list.yml index 4ed76cb..3eb8306 100644 --- a/.github/workflows/update-token-list.yml +++ b/.github/workflows/update-token-list.yml @@ -150,7 +150,7 @@ jobs: git push origin --delete ${{ env.branch_name }} else echo "Branch does not exist remotely." - fi + fi - name: Commit changes run: | From 92a846d90146bf10da7fc58ec147ce503086b509 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 12 Sep 2024 17:12:15 +0000 Subject: [PATCH 14/14] Add token 0x8a5d207b7CD70c073203346703CD619d7790BC9D Xanezu (XNZ) --- .github/workflows/cleanup-branches.yml | 34 ---- .github/workflows/sync-with-upstream.yml | 62 ------ .github/workflows/update-token-list.yml | 178 ------------------ FXList.json | 11 ++ .../logo.png | Bin 0 -> 8434 bytes 5 files changed, 11 insertions(+), 274 deletions(-) delete mode 100644 .github/workflows/cleanup-branches.yml delete mode 100644 .github/workflows/sync-with-upstream.yml delete mode 100644 .github/workflows/update-token-list.yml create mode 100644 Tokens/0x8a5d207b7CD70c073203346703CD619d7790BC9D/logo.png diff --git a/.github/workflows/cleanup-branches.yml b/.github/workflows/cleanup-branches.yml deleted file mode 100644 index fe10747..0000000 --- a/.github/workflows/cleanup-branches.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Cleanup Stale Branches - -on: - schedule: - # Runs at 00:00 every day - - cron: "0 0 * * *" - workflow_dispatch: - -jobs: - delete_old_branches: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Fetch all branches - run: git fetch --all - - - name: Delete stale branches - run: | - # Get the date 7 days ago in YYYY-MM-DD format - seven_days_ago=$(date -d '7 days ago' +%Y-%m-%d) - - # List branches that haven't been updated in the last 7 days - for branch in $(git for-each-ref --format='%(refname:short) %(committerdate:short)' refs/remotes/origin | awk -v date="$seven_days_ago" '$2 <= date {print $1}'); do - # Ensure the branch is not 'main', 'master', or any protected branches - if [[ "$branch" != "origin/main" && "$branch" != "origin/master" && "$branch" != *"HEAD"* ]]; then - git push origin --delete ${branch#origin/} - echo "Deleted branch $branch" - fi - done - - - name: Cleanup - run: git remote prune origin diff --git a/.github/workflows/sync-with-upstream.yml b/.github/workflows/sync-with-upstream.yml deleted file mode 100644 index 11203cb..0000000 --- a/.github/workflows/sync-with-upstream.yml +++ /dev/null @@ -1,62 +0,0 @@ -name: Sync with Upstream - -on: - schedule: - - cron: "0 * * * *" # Runs every hour, adjust the cron schedule as needed - workflow_dispatch: - -jobs: - sync: - runs-on: ubuntu-latest - - steps: - - name: Checkout Forked Repo - uses: actions/checkout@v3 - with: - repository: marginx-spot-trade/FXSwap-TokenList - token: ${{ secrets.TOKEN }} - fetch-depth: 0 - - - name: Set Up Git - run: | - git config --global user.name 'github-actions' - git config --global user.email 'github-actions@github.com' - - - name: Add Upstream Remote - run: git remote add upstream https://github.com/FunctionX-SG/FXSwap-TokenList.git - - - name: Fetch Upstream Changes - run: git fetch upstream - - - name: Check for Differences in Tokens Directory and FXList.json - id: check_diff - run: | - git fetch upstream main - if git diff --quiet upstream/main -- Tokens FXList.json; then - echo "changes=false" >> $GITHUB_ENV - else - echo "changes=true" >> $GITHUB_ENV - fi - - - name: Merge Upstream Changes and Preserve All Workflows - if: env.changes == 'true' - run: | - git merge -X ours --no-commit upstream/main || true - # Ensure all workflow files are preserved - for file in .github/workflows/*; do - if [ -e "$file" ]; then - git checkout --ours "$file" - fi - done - git add .github/workflows/ - git commit -m "Merge upstream changes while keeping all forked workflows" - - - name: Pull Latest Changes from Origin - if: env.changes == 'true' - run: git pull origin main --rebase - - - name: Push Changes - if: env.changes == 'true' - run: git push origin main - env: - GITHUB_TOKEN: ${{ secrets.TOKEN }} diff --git a/.github/workflows/update-token-list.yml b/.github/workflows/update-token-list.yml deleted file mode 100644 index 3eb8306..0000000 --- a/.github/workflows/update-token-list.yml +++ /dev/null @@ -1,178 +0,0 @@ -name: Update Token List - -on: - workflow_dispatch: - inputs: - name: - description: "Token name" - required: true - chainId: - description: "Chain ID" - required: true - symbol: - description: "Token symbol" - required: true - address: - description: "Token address" - required: true - decimals: - description: "Token decimals" - required: true - image: - description: "Token logo (base64 encoded)" - required: true - twitter: - description: "Twitter handle" - required: false - website: - description: "Website URL" - required: false - -jobs: - update-token-list: - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Set up Node.js - uses: actions/setup-node@v3 - with: - node-version: "20" - - - name: Set up Git configuration - run: | - git config user.name "GitHub Actions" - git config user.email "actions@github.com" - git config core.autocrlf input - - - name: Determine logo file name - id: determine_logo - run: | - case "${{ github.event.inputs.chainId }}" in - 530) - logo_filename="logo.png" - ;; - 90001) - logo_filename="logo-testnet.png" - ;; - 7000) - logo_filename="logo-zeta.png" - ;; - 7001) - logo_filename="logo-athens.png" - ;; - *) - logo_filename="logo.png" - ;; - esac - echo "logo_filename=$logo_filename" >> $GITHUB_ENV - - - name: Debug inputs - run: | - echo "Twitter: '${{ github.event.inputs.twitter }}'" - echo "Website: '${{ github.event.inputs.website }}'" - - - name: Decode and save image - run: | - mkdir -p Tokens/${{ github.event.inputs.address }} - echo "${{ github.event.inputs.image }}" | base64 --decode > Tokens/${{ github.event.inputs.address }}/${{ env.logo_filename }} - - - name: List files in Tokens directory - run: ls -R Tokens/ - - - name: Prepare branch and token entry - id: prepare - run: | - name="${{ github.event.inputs.name }}" - symbol="${{ github.event.inputs.symbol }}" - address="${{ github.event.inputs.address }}" - sanitized_name=$(echo "$name" | tr ' ' '-' | tr -cd '[:alnum:]-') - sanitized_symbol=$(echo "$symbol" | tr ' ' '-' | tr -cd '[:alnum:]-') - sanitized_address=$(echo "$address" | tr ' ' '-' | tr -cd '[:alnum:]-') - branch_name="add-token-$sanitized_address-$sanitized_name-$sanitized_symbol" - - # Save branch name to be used in subsequent steps - echo "branch_name=$branch_name" >> $GITHUB_ENV - - - name: Pull latest changes from main - run: | - git checkout main - git pull origin main - - - name: Print branch name - run: | - echo "Branch name: ${{ env.branch_name }}" - - - name: Normalize line endings in FXList.json - run: | - awk '{ sub("\r$", ""); print }' FXList.json > tmp.FXList.json && mv tmp.FXList.json FXList.json - - - name: Format FXList.json before changes - run: | - jq --indent 4 . FXList.json > tmp.FXList.json && mv tmp.FXList.json FXList.json - - - name: Append new token to FXList.json - run: | - logoURI="https://raw.githubusercontent.com/FunctionX-SG/FXSwap-TokenList/main/Tokens/${{ github.event.inputs.address }}/${{ env.logo_filename }}" - # Create token entry - token_entry=$(jq -n \ - --arg name "${{ github.event.inputs.name }}" \ - --argjson chainId "${{ github.event.inputs.chainId }}" \ - --arg symbol "${{ github.event.inputs.symbol }}" \ - --argjson decimals "${{ github.event.inputs.decimals }}" \ - --arg address "${{ github.event.inputs.address }}" \ - --arg logoURI "$logoURI" \ - --arg twitter "${{ github.event.inputs.twitter }}" \ - --arg website "${{ github.event.inputs.website }}" \ - '{name: $name, chainId: $chainId, symbol: $symbol, decimals: $decimals, address: $address, logoURI: $logoURI, extensions: {twitter: $twitter, website: $website}} | with_entries(select(.value != "" and .value != null)) | .extensions |= with_entries(select(.value != "" and .value != null))') - # Append the new entry to the tokens array in FXList.json - jq --argjson token_entry "$token_entry" '.tokens += [$token_entry]' FXList.json > tmp.FXList.json && mv tmp.FXList.json FXList.json - - - name: Format FXList.json after changes - run: | - jq --indent 4 . FXList.json > tmp.FXList.json && mv tmp.FXList.json FXList.json - - - name: Check if branch exists locally and delete if it does - run: | - if git show-ref --quiet refs/heads/${{ env.branch_name }}; then - echo "Branch exists locally. Deleting local branch ${{ env.branch_name }}." - git branch -D ${{ env.branch_name }} - else - echo "Branch does not exist locally." - fi - - - name: Check if branch exists remotely and delete if it does - run: | - if git ls-remote --exit-code --heads origin ${{ env.branch_name }}; then - echo "Branch exists remotely. Deleting remote branch ${{ env.branch_name }}." - git push origin --delete ${{ env.branch_name }} - else - echo "Branch does not exist remotely." - fi - - - name: Commit changes - run: | - git checkout -b ${{ env.branch_name }} - git rm -r .github/workflows - git add FXList.json Tokens/${{ github.event.inputs.address }}/${{ env.logo_filename }} - git commit -m "Add token ${{ github.event.inputs.address }} ${{ github.event.inputs.name }} (${{ github.event.inputs.symbol }})" - git pull origin main --rebase - git push origin ${{ env.branch_name }} - - - name: Install GitHub CLI - run: | - sudo apt-get update - sudo apt-get install gh - - - name: Create Pull Request with GH CLI - env: - GH_TOKEN: ${{ secrets.TOKEN }} - run: | - gh pr create --repo FunctionX-SG/FXSwap-TokenList --base main --head marginx-spot-trade:${{ env.branch_name }} --title "Add ${{ github.event.inputs.name }} Token" --body "This PR adds a new token with address ${{ github.event.inputs.address }}, name '${{ github.event.inputs.name }}' and symbol '${{ github.event.inputs.symbol }}'." - - # gh pr create --title "Add ${{ github.event.inputs.name }} Token" \ - # --body "This PR adds a new token with name '${{ github.event.inputs.name }}' and symbol '${{ github.event.inputs.symbol }}'." \ - # --base main \ - # --head marginx-spot-trade:${{ env.branch_name }} diff --git a/FXList.json b/FXList.json index 394f4fb..fab38e2 100644 --- a/FXList.json +++ b/FXList.json @@ -1023,6 +1023,17 @@ "twitter": "www.x.com/test", "website": "www.test.com" } + }, + { + "name": "Xanezu", + "chainId": 530, + "symbol": "XNZ", + "decimals": 18, + "address": "0x8a5d207b7CD70c073203346703CD619d7790BC9D", + "logoURI": "https://raw.githubusercontent.com/FunctionX-SG/FXSwap-TokenList/main/Tokens/0x8a5d207b7CD70c073203346703CD619d7790BC9D/logo.png", + "extensions": { + "twitter": "https://x.com/Xanezu_Oficial" + } } ] } diff --git a/Tokens/0x8a5d207b7CD70c073203346703CD619d7790BC9D/logo.png b/Tokens/0x8a5d207b7CD70c073203346703CD619d7790BC9D/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..ab36e30eb15278ced4704a06d1d1717c23965633 GIT binary patch literal 8434 zcmVa%oJjnN4!x_J~>_x3x$>(8#hRXrkPVqpvql-ZQp@ukvGfOI^j7 zy7>Pfa8tQ#y=p3tQa_b;sO5(rhZo};*AN!G=<^n1Lwmzjkw~vMyLg%1q>k}L%<*e(g2AA_=Rcp z2!luj*fj$YhBO2rIvEztAQ5CLQ1AqRl-dYSu+>(&(W03Vr=kx5#oJ;YAnq{$uzXAe zuz_I+Ks{Aaqbhf<9RoT#!Q~S4dLSe`5~eUKBY^=!XcDw%HVc?~VH$m~LL0yzsEk-) zLr&u2ZIz!kCMa5iwtNOMvJutjaAv0pvSVNxoXN}4EH;YDEKYzGA+zb2k7UdRO6ABH zd{r=D*GK`T@QhhbsXd_tZi2Wmje{8+Kt~=>)JB5c1cYuAd-LQ-ub+*+f=^ z?4`*i$gAmvp|4a0W4c;Tnt-4fi#rY0KfMj%H!u~arey}z9eHH707NZOWfaTBq{@+3 zp}LW4D%Ws8MwqlLsBBR^K*;^q69^%hj1w_gf!QVerwKckKOiE@1gg@CP1uAn65!5Y zg>W3DoC`;ATbUp-k&uVMpqqtm7YHN=d|b7^s_ejt!_7fZ6@i*9pqlz@%m9OSK}ccK zKkxTEDeeCG!Df|EF6_V$hA3oEvgTdFRMo*2Bir|+@WYvBjY<2o!3Y;-YR)eR=zeIs zNG9oXn-o@iR*JNrOB2usA_)bCVTcskl=!Rm6MKD@4LnAFJhC!Gnm`>pGaV>pquD0v zd=}&%BYNp1+xv?jErUF{r=5^momkM`rzIaw7Pg)@GqO)q>FTa!l+t@v5U_l~c}gyX zMnqj;hZBcQjI9@Eb04i-d2*kMEIuIN*qG>nnC|?kN&nYJ)&x?1Mg?YM(hBUa(`E(q zJ~gv1XMf$bCX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