Automated build update #4
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Notify Telegram on JSON Update | |
on: | |
push: | |
branches: | |
# - master | |
- feat/telegram-bot | |
paths: | |
- '**/voltage-swap-default.tokenlist.json' | |
jobs: | |
notify: | |
environment: TELEGRAM | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '14' | |
- name: Install dependencies | |
run: npm install | |
- name: Run notify script | |
run: npm run notify:telegram | |
env: | |
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }} | |
TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }} | |
- name: Commit changes | |
run: | | |
git add . | |
git push | |
git config --global user.name "GitHub Action" | |
git config --global user.email "[email protected]" | |
# Get the current branch name | |
BRANCH_NAME=${GITHUB_HEAD_REF} | |
git fetch origin $BRANCH_NAME | |
git checkout $BRANCH_NAME | |
git add . | |
git commit -m "Clean new-token.json" | |
git rebase origin/$BRANCH_NAME | |
git push origin HEAD:$BRANCH_NAME | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |