add dam token #7
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: Update Token List on PR Merge | |
on: | |
pull_request: | |
types: [closed] | |
jobs: | |
update-token-list: | |
if: github.event.pull_request.merged == true | |
runs-on: ubuntu-latest | |
steps: | |
- name: Create GitHub App token | |
uses: actions/create-github-app-token@v1 | |
id: app-token | |
with: | |
app-id: ${{ vars.UPDATE_LIST_APPID }} | |
private-key: ${{ secrets.UPDATE_LIST_SECRET }} | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
token: ${{ steps.app-token.outputs.token }} | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: Update token-list.json | |
run: python .github/scripts/update-token-list.py | |
- name: Commit and push changes | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
git add chains/**/token-list.json | |
if git diff-index --quiet HEAD; then | |
echo "No changes to commit" | |
else | |
git commit -m 'Update token-list.json files' | |
git push origin HEAD:${{ github.ref }} | |
fi |