|
| 1 | +name: Update Node version |
| 2 | +on: |
| 3 | + workflow_dispatch: |
| 4 | + schedule: |
| 5 | + - cron: '15 12 * * *' # At 12:15 PM UTC every day |
| 6 | + |
| 7 | +permissions: |
| 8 | + contents: write |
| 9 | + pull-requests: write |
| 10 | + |
| 11 | +jobs: |
| 12 | + create-pr: |
| 13 | + name: Create PR |
| 14 | + runs-on: ubuntu-latest |
| 15 | + steps: |
| 16 | + - name: Checkout |
| 17 | + uses: actions/checkout@v4 |
| 18 | + - uses: actions/setup-node@v4 |
| 19 | + with: |
| 20 | + node-version-file: extensions/ql-vscode/.nvmrc |
| 21 | + cache: 'npm' |
| 22 | + cache-dependency-path: extensions/ql-vscode/package-lock.json |
| 23 | + - name: Install dependencies |
| 24 | + working-directory: extensions/ql-vscode |
| 25 | + run: | |
| 26 | + npm ci |
| 27 | + shell: bash |
| 28 | + - name: Get current Node version |
| 29 | + working-directory: extensions/ql-vscode |
| 30 | + id: get-current-node-version |
| 31 | + run: | |
| 32 | + echo "version=$(cat .nvmrc)" >> $GITHUB_OUTPUT |
| 33 | + shell: bash |
| 34 | + - name: Update Node version |
| 35 | + working-directory: extensions/ql-vscode |
| 36 | + run: | |
| 37 | + npx ts-node scripts/update-node-version.ts |
| 38 | + shell: bash |
| 39 | + - name: Get current Node version |
| 40 | + working-directory: extensions/ql-vscode |
| 41 | + id: get-new-node-version |
| 42 | + run: | |
| 43 | + echo "version=$(cat .nvmrc)" >> $GITHUB_OUTPUT |
| 44 | + shell: bash |
| 45 | + - name: Commit, Push and Open a PR |
| 46 | + uses: ./.github/actions/create-pr |
| 47 | + with: |
| 48 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 49 | + base-branch: main |
| 50 | + head-branch: github-action/bump-node-version |
| 51 | + commit-message: Bump Node version to ${{ steps.get-new-node-version.outputs.version }} |
| 52 | + title: Bump Node version to ${{ steps.get-new-node-version.outputs.version }} |
| 53 | + body: > |
| 54 | + The Node version used in the latest version of VS Code has been updated. This PR updates the Node version |
| 55 | + used for integration tests to match. |
| 56 | +
|
| 57 | + The previous Node version was ${{ steps.get-current-node-version.outputs.version }}. This PR updates the |
| 58 | + Node version to ${{ steps.get-new-node-version.outputs.version }}. |
0 commit comments