daily #1792
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 | |
| on: | |
| schedule: | |
| - cron: '5 5 * * *' # 05:05 (UTC) | |
| permissions: {} | |
| env: | |
| UPDATE_DEPS_TITLE: 'build(deps): update dependencies' | |
| jobs: | |
| # https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#authenticating-with-github-app-generated-tokens | |
| update-deps: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0 | |
| id: app-token | |
| with: | |
| # app-id was deprecated in 3.1.0 | |
| client-id: ${{ secrets.CI_BOT_APP_ID }} | |
| private-key: ${{ secrets.CI_BOT_PRIVATE_KEY }} | |
| # The access will be scoped to only the current repository. | |
| permission-contents: write | |
| permission-pull-requests: write | |
| - name: Get GitHub App User ID | |
| id: get-user-id | |
| run: | | |
| USER_ID=$(gh api "/users/${APP_SLUG}[bot]" --jq .id) | |
| echo "user-id=$USER_ID" >>"$GITHUB_OUTPUT" | |
| env: | |
| GH_TOKEN: ${{ steps.app-token.outputs.token }} | |
| APP_SLUG: ${{ steps.app-token.outputs.app-slug }} | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| token: ${{ steps.app-token.outputs.token }} | |
| submodules: recursive | |
| # Fetch all history for all branches and tags | |
| # so that ./scripts/update-deps works properly. | |
| fetch-depth: 0 | |
| # See https://github.com/tschaub/gh-pages/issues/384#issuecomment-1236047843 | |
| - name: set origin url (workaround) | |
| run: | | |
| git remote set-url origin "https://x-access-token:${TOKEN}@github.com/${GITHUB_REPOSITORY}" | |
| env: | |
| TOKEN: ${{ steps.app-token.outputs.token }} | |
| - name: Update dependencies | |
| id: update-deps | |
| run: | | |
| ./scripts/update-deps /tmp/update-deps.log.md | |
| echo "body=/tmp/update-deps.log.md" >>"$GITHUB_OUTPUT" | |
| env: | |
| # GH_TOKEN is used by `gh api` command in update-mirakc-arib.sh. | |
| GH_TOKEN: ${{ steps.app-token.outputs.token }} | |
| - name: Create Pull Request | |
| uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1 | |
| with: | |
| token: ${{ steps.app-token.outputs.token }} | |
| title: ${{ env.UPDATE_DEPS_TITLE }} | |
| body-path: ${{ steps.update-deps.outputs.body }} | |
| commit-message: ${{ env.UPDATE_DEPS_TITLE }} | |
| author: > | |
| ${{ steps.app-token.outputs.app-slug }}[bot] <${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com> | |
| branch: update-deps | |
| delete-branch: true | |
| labels: dependencies |