|
| 1 | +<<<<<<< Updated upstream |
1 | 2 | name: Update README from CONTRIBUTE_README |
2 | 3 |
|
3 | 4 | # Workflow disabled |
@@ -109,3 +110,66 @@ jobs: |
109 | 110 | echo "- **Lines**: $(wc -l < README.md)" >> $GITHUB_STEP_SUMMARY |
110 | 111 | echo "- **Size**: $(du -h README.md | cut -f1)" >> $GITHUB_STEP_SUMMARY |
111 | 112 | echo "- **Badges**: $(grep -c 'img.shields.io' README.md)" >> $GITHUB_STEP_SUMMARY |
| 113 | +||||||| Stash base |
| 114 | +======= |
| 115 | +name: Update README |
| 116 | + |
| 117 | +on: |
| 118 | + schedule: |
| 119 | + # Run once a week on Monday at 00:00 UTC |
| 120 | + - cron: '0 0 * * 1' |
| 121 | + workflow_dispatch: # Allow manual triggering |
| 122 | + push: |
| 123 | + branches: |
| 124 | + - master |
| 125 | + paths: |
| 126 | + - 'CONTRIBUTE_README.md' |
| 127 | + - 'scripts/**' |
| 128 | + |
| 129 | +jobs: |
| 130 | + update-readme: |
| 131 | + runs-on: ubuntu-latest |
| 132 | + |
| 133 | + steps: |
| 134 | + - name: Checkout repository |
| 135 | + uses: actions/checkout@v4 |
| 136 | + with: |
| 137 | + fetch-depth: 0 # Fetch all history for git operations |
| 138 | + |
| 139 | + - name: Set up Java |
| 140 | + uses: actions/setup-java@v4 |
| 141 | + with: |
| 142 | + distribution: 'temurin' |
| 143 | + java-version: '25' |
| 144 | + |
| 145 | + - name: Checkout existing stats cache |
| 146 | + run: | |
| 147 | + mkdir -p .tmp |
| 148 | + # Try to restore stats cache from previous run |
| 149 | + if git show HEAD:.tmp/github-stats.txt > .tmp/github-stats.txt 2>/dev/null; then |
| 150 | + echo "Restored existing stats cache from previous commit" |
| 151 | + else |
| 152 | + echo "No existing stats cache found, will fetch all data" |
| 153 | + fi |
| 154 | +
|
| 155 | + - name: Run workflow |
| 156 | + env: |
| 157 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 158 | + run: | |
| 159 | + java --enable-preview --source 25 scripts/run_workflow.java |
| 160 | +
|
| 161 | + - name: Commit changes |
| 162 | + run: | |
| 163 | + git config --local user.email "[email protected]" |
| 164 | + git config --local user.name "GitHub Action" |
| 165 | + git add README.md |
| 166 | + # Always commit the stats cache so it persists for next run |
| 167 | + git add .tmp/github-stats.txt || true |
| 168 | + if git diff --staged --quiet; then |
| 169 | + echo "No changes to commit" |
| 170 | + else |
| 171 | + git commit -m "Update README with latest GitHub stars and commit dates [skip ci]" |
| 172 | + git push |
| 173 | + fi |
| 174 | +
|
| 175 | +>>>>>>> Stashed changes |
0 commit comments