Update dependencies #22807
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: Update dependencies | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| repoCache: | |
| description: "Reset or disable the cache?" | |
| type: choice | |
| default: enabled | |
| options: | |
| - enabled | |
| - disabled | |
| - reset | |
| logLevel: | |
| description: "Override default log level" | |
| type: choice | |
| default: info | |
| options: | |
| - "debug" | |
| - "info" | |
| - "warn" | |
| - "error" | |
| overrideSchedule: | |
| description: "Override all schedules" | |
| type: boolean | |
| default: false | |
| dryRun: | |
| description: "Dry run mode" | |
| type: choice | |
| default: disabled | |
| options: | |
| - disabled | |
| - extract | |
| - lookup | |
| - full | |
| schedule: | |
| # Run every 30 minutes | |
| - cron: "0/30 * * * *" | |
| env: | |
| cache_archive: renovate_cache.tar.gz | |
| cache_dir: /tmp/renovate/cache/renovate/repository | |
| cache_key: renovate-cache | |
| dry_run: ${{ github.event.inputs.dryRun || 'disabled' }} | |
| concurrency: | |
| cancel-in-progress: false | |
| group: renovate | |
| permissions: | |
| contents: write | |
| id-token: write | |
| jobs: | |
| renovate: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Authenticate Vault | |
| id: secrets | |
| uses: hashicorp/vault-action@4c06c5ccf5c0761b6029f56cfb1dcf5565918a3b # v3.4.0 | |
| with: | |
| url: ${{ secrets.VAULT_ADDR }} | |
| method: jwt | |
| role: dev | |
| secrets: | | |
| automation/data/pipelines/hash/dev github_worker_app_id | GITHUB_WORKER_APP_ID ; | |
| automation/data/pipelines/hash/dev github_worker_app_private_key | GITHUB_WORKER_APP_PRIVATE_KEY ; | |
| - name: Get token | |
| id: app-token | |
| uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1 | |
| with: | |
| app-id: ${{ steps.secrets.outputs.GITHUB_WORKER_APP_ID }} | |
| private-key: ${{ steps.secrets.outputs.GITHUB_WORKER_APP_PRIVATE_KEY }} | |
| - name: Checkout | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| token: ${{ steps.app-token.outputs.token }} | |
| - name: Install Node.js | |
| uses: jdx/mise-action@146a28175021df8ca24f8ee1828cc2a60f980bd5 # v3.5.1 | |
| with: | |
| install_args: node npm:renovate | |
| env: | |
| MISE_NODE_COREPACK: 1 | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Download renovate cache | |
| uses: dawidd6/action-download-artifact@ac66b43f0e6a346234dd65d4d0c8fbb31cb316e5 # v11 | |
| if: github.event.inputs.repoCache != 'disabled' | |
| continue-on-error: true | |
| with: | |
| name: ${{ env.cache_key }} | |
| path: cache-download | |
| - name: Extract renovate cache | |
| if: github.event.inputs.repoCache != 'disabled' | |
| run: | | |
| if [ ! -d cache-download ] ; then | |
| echo "No cache found." | |
| exit 0 | |
| fi | |
| mkdir -p $cache_dir | |
| tar -xzf cache-download/$cache_archive -C $cache_dir | |
| - name: Run renovate | |
| env: | |
| LOG_LEVEL: ${{ inputs.logLevel || 'info' }} | |
| RENOVATE_FORCE: ${{ github.event.inputs.overrideSchedule == 'true' && '{"schedule":null}' || '' }} | |
| RENOVATE_DRY_RUN: ${{ env.dry_run == 'disabled' && 'null' || inputs.dryRun }} | |
| RENOVATE_PLATFORM_COMMIT: enabled | |
| RENOVATE_REPOSITORIES: ${{ github.repository }} | |
| # TODO: Consider using S3 by setting `RENOVATE_REPOSITORY_CACHE_TYPE` | |
| # see: https://linear.app/hash/issue/H-3315/use-s3-to-store-renovate-cache | |
| RENOVATE_REPOSITORY_CACHE: ${{ github.event.inputs.repoCache || 'enabled' }} | |
| run: renovate --token ${{ steps.app-token.outputs.token }} | |
| - name: Compress renovate cache | |
| run: tar -czvf $cache_archive -C $cache_dir . | |
| - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| if: env.dry_run == 'disabled' && github.event.inputs.repoCache != 'disabled' | |
| with: | |
| name: ${{ env.cache_key }} | |
| path: ${{ env.cache_archive }} | |
| retention-days: 1 |