|
| 1 | +name: "auto-readme" |
| 2 | +on: |
| 3 | + schedule: |
| 4 | + # Example of job definition: |
| 5 | + # .---------------- minute (0 - 59) |
| 6 | + # | .------------- hour (0 - 23) |
| 7 | + # | | .---------- day of month (1 - 31) |
| 8 | + # | | | .------- month (1 - 12) OR jan,feb,mar,apr ... |
| 9 | + # | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat |
| 10 | + # | | | | | |
| 11 | + # * * * * * user-name command to be executed |
| 12 | + |
| 13 | + # Update README.md nightly at 4am UTC |
| 14 | + - cron: '0 4 * * *' |
| 15 | + |
| 16 | +jobs: |
| 17 | + update: |
| 18 | + if: github.event_name == 'schedule' |
| 19 | + runs-on: ubuntu-latest |
| 20 | + steps: |
| 21 | + - uses: actions/checkout@v2 |
| 22 | + |
| 23 | + - name: Update readme |
| 24 | + shell: bash |
| 25 | + id: update |
| 26 | + env: |
| 27 | + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" |
| 28 | + run: | |
| 29 | + make init |
| 30 | + make readme/build |
| 31 | + # Ignore changes if they are only whitespace |
| 32 | + git diff --ignore-all-space --ignore-blank-lines --quiet README.md && { git restore README.md; echo Ignoring whitespace-only changes in README; } |
| 33 | +
|
| 34 | + - name: Create Pull Request |
| 35 | + # This action will not create or change a pull request if there are no changes to make. |
| 36 | + # If a PR of the auto-update/readme branch is open, this action will just update it, not create a new PR. |
| 37 | + uses: cloudposse/actions/github/[email protected] |
| 38 | + with: |
| 39 | + token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }} |
| 40 | + commit-message: Update README.md and docs |
| 41 | + title: Update README.md and docs |
| 42 | + body: |- |
| 43 | + ## what |
| 44 | + This is an auto-generated PR that updates the README.md and docs |
| 45 | +
|
| 46 | + ## why |
| 47 | + To have most recent changes of README.md and doc from origin templates |
| 48 | +
|
| 49 | + branch: auto-update/readme |
| 50 | + base: main |
| 51 | + delete-branch: true |
| 52 | + labels: | |
| 53 | + auto-update |
| 54 | + no-release |
| 55 | + readme |
0 commit comments