|
| 1 | +name: V8 update |
| 2 | +on: |
| 3 | + schedule: |
| 4 | + # Run once a week at 00:05 AM UTC on Sunday. |
| 5 | + - cron: 5 0 * * 0 |
| 6 | + workflow_dispatch: |
| 7 | + |
| 8 | +env: |
| 9 | + NODE_VERSION: lts/* |
| 10 | + |
| 11 | +permissions: |
| 12 | + contents: read |
| 13 | + |
| 14 | +jobs: |
| 15 | + v8-update: |
| 16 | + if: github.repository == 'nodejs/node' |
| 17 | + runs-on: ubuntu-latest |
| 18 | + steps: |
| 19 | + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 |
| 20 | + with: |
| 21 | + persist-credentials: false |
| 22 | + - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 |
| 23 | + with: |
| 24 | + path: | |
| 25 | + ~/.update-v8 |
| 26 | + ~/.npm |
| 27 | + # Install dependencies |
| 28 | + - name: Install Node.js |
| 29 | + uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 |
| 30 | + with: |
| 31 | + node-version: ${{ env.NODE_VERSION }} |
| 32 | + - name: Install node-core-utils |
| 33 | + run: npm install -g node-core-utils@latest |
| 34 | + - name: Check and download new V8 version |
| 35 | + run: | |
| 36 | + ./tools/dep_updaters/update-v8-patch.sh > temp-output |
| 37 | + cat temp-output |
| 38 | + tail -n1 temp-output | grep "NEW_VERSION=" >> "$GITHUB_ENV" || true |
| 39 | + rm temp-output |
| 40 | + - name: Generate commit message if not set |
| 41 | + if: env.COMMIT_MSG == '' |
| 42 | + run: | |
| 43 | + echo "COMMIT_MSG=deps: update v8 to ${{ env.NEW_VERSION }}" >> "$GITHUB_ENV" |
| 44 | + - uses: gr2m/create-or-update-pull-request-action@77596e3166f328b24613f7082ab30bf2d93079d5 |
| 45 | + # Creates a PR or update the Action's existing PR, or |
| 46 | + # no-op if the base branch is already up-to-date. |
| 47 | + env: |
| 48 | + GITHUB_TOKEN: ${{ secrets.GH_USER_TOKEN }} |
| 49 | + with: |
| 50 | + author: Node.js GitHub Bot <[email protected]> |
| 51 | + body: This is an automated update of v8 to ${{ env.NEW_VERSION }}. |
| 52 | + branch: actions/update-v8-patch # Custom branch *just* for this Action. |
| 53 | + commit-message: ${{ env.COMMIT_MSG }} |
| 54 | + labels: dependencies |
| 55 | + title: 'deps: update v8 to ${{ env.NEW_VERSION }}' |
| 56 | + update-pull-request-title-and-body: true |
0 commit comments