-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: automate updating the release data
- Loading branch information
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Fetch release data | ||
on: | ||
schedule: | ||
# Run every 8 hours | ||
- cron: '0 */8 * * *' | ||
workflow_dispatch: | ||
permissions: | ||
contents: write | ||
jobs: | ||
fetch-release-data: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
sparse-checkout: | | ||
scripts | ||
static/data/releases | ||
- run: | | ||
./scripts/fetch-releases.sh | ||
if git diff --quiet static/data/releases; then | ||
echo "No changes to commit" | ||
exit 0 | ||
fi | ||
git config user.name "github-actions[bot]" | ||
git config user.email "github-actions[bot]@users.noreply.github.com" | ||
git add static/data/releases | ||
git commit -m "Update release data" | ||
git push | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |