Skip to content

Commit

Permalink
ammend update-token-list.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
in-incognito committed Aug 21, 2024
1 parent fe101bc commit 2a1f6a0
Showing 1 changed file with 23 additions and 17 deletions.
40 changes: 23 additions & 17 deletions .github/workflows/update-token-list.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand Down Expand Up @@ -129,30 +134,31 @@ 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: |
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
Expand Down

0 comments on commit 2a1f6a0

Please sign in to comment.