mirror of
https://github.com/LukeHagar/usage-statistics.git
synced 2025-12-06 04:21:55 +00:00
Add Usage Statistics Tracker GitHub Action with configuration options, outputs, and README integration
This commit is contained in:
33
examples/basic-usage.yml
Normal file
33
examples/basic-usage.yml
Normal file
@@ -0,0 +1,33 @@
|
||||
name: Update Usage Statistics
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 0 * * *' # Daily at midnight
|
||||
workflow_dispatch: # Allow manual triggering
|
||||
|
||||
jobs:
|
||||
update-stats:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Usage Statistics Tracker
|
||||
uses: your-username/usage-statistics@v1
|
||||
with:
|
||||
config: 'production'
|
||||
json-output-path: 'stats.json'
|
||||
csv-output-path: 'stats.csv'
|
||||
report-output-path: 'docs/usage-report.md'
|
||||
update-readme: 'true'
|
||||
readme-path: 'README.md'
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Commit and push changes
|
||||
run: |
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git add stats.json stats.csv docs/usage-report.md README.md
|
||||
git commit -m "chore: update usage statistics [skip ci]" || echo "No changes to commit"
|
||||
git push
|
||||
Reference in New Issue
Block a user