Skip to content

Update README.md

Update README.md #2

Workflow file for this run

name: Update Watchers Count
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
jobs:
update-readme:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Fetch watchers count
run: |
WATCHERS_JSON=$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -s "https://api.github.com/repos/SeyedMuhammadHosseinMousavi/CHFP-DVAE-Conditional-Hierarchical-Fuzzy-PSO-Disentangled-VAE/subscribers")
WATCHERS=$(echo "$WATCHERS_JSON" | jq '. | length')
echo "WATCHERS_COUNT=$WATCHERS"
echo "WATCHERS_COUNT=$WATCHERS" >> $GITHUB_ENV
- name: Display watchers count
run: echo "Number of Watchers: ${{ env.WATCHERS_COUNT }}"

Check failure on line 20 in .github/workflows/main.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/main.yml

Invalid workflow file

You have an error in your yaml syntax on line 20
- name: Update README
run: |
sed -i "s/Total Watchers:.*/Total Watchers: ${{ env.WATCHERS_COUNT }}/g" README.md
cat README.md
- name: Commit and push if changes
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Action"
git add README.md
git commit -m "Updated Watchers Count" -a || echo "No changes to commit"
git push