daily-update #17
This file contains hidden or 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
| name: daily-update | |
| on: | |
| schedule: | |
| - cron: '0 6 * * *' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| update: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| track: [iam, security, whats-new, releases] | |
| runs-on: ubuntu-latest | |
| concurrency: | |
| group: update-${{ matrix.track }} | |
| cancel-in-progress: false | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| # Pin to main so a workflow_dispatch from a feature branch can't | |
| # publish data based on non-main code (the commit still lands on main). | |
| ref: main | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.12' | |
| cache: pip | |
| cache-dependency-path: requirements.txt | |
| - run: pip install -r requirements.txt | |
| - name: Run pipeline | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: make -C tracks/${{ matrix.track }} update | |
| - name: Commit and push | |
| run: | | |
| git config user.name 'github-actions[bot]' | |
| git config user.email '41898282+github-actions[bot]@users.noreply.github.com' | |
| git add tracks/${{ matrix.track }} | |
| if git diff --staged --quiet; then | |
| echo "No changes." | |
| exit 0 | |
| fi | |
| git commit -m "chore(${{ matrix.track }}): daily update $(date -u +%Y-%m-%d)" | |
| for i in 1 2 3 4 5; do | |
| if git pull --rebase origin main && git push origin HEAD:main; then | |
| exit 0 | |
| fi | |
| sleep $((i * 5)) | |
| done | |
| exit 1 |