Skip to content

like-banner

like-banner #1855

Workflow file for this run

name: like-banner
on:
schedule:
- cron: '0 */12 * * *'
workflow_dispatch:
jobs:
get-likes:
runs-on: ubuntu-latest
env:
TWITTER_BEARER_TOKEN: ${{ secrets.TWITTER_BEARER_TOKEN }}
steps:
- uses: actions/checkout@v3
with:
ref: twitter-like-badge
- name: git config
run: |
git config user.email [email protected]
git config user.name github-actions
- name: TWITTER API with curl
run: |
curl 'https://api.twitter.com/2/tweets?ids=1511034067344572422&tweet.fields=public_metrics&expansions=attachments.media_keys&media.fields=public_metrics' --header 'Authorization: Bearer ${{ secrets.TWITTER_BEARER_TOKEN }}' -o likes
shell: bash
- name: Commit and Push changes
run: |
git diff-index --quiet HEAD || (git commit -a -m'[bot]: update latest twitter likes data' --allow-empty && git push -f)