Closed ghost closed 12 months ago
We could also go a step further by using the latest version to prevent further manual updates by using the following:
env:
NODE_VERSION: latest
Note that this will use the latest stable, not the lts.
Alternatively, we can check what the latest its is with, but this may not be needed as we've defined the use of the latest major release:
env:
CHECK_LATEST: true
with:
check-latest: ${{ env.CHECK_LATEST }}
Node.js 20 will reach long-term support in October as well, so we can handle that later in a new pr, or this one by setting:
env:
NODE_VERSION: 20
If I understand correctly with check-latest: true
- action first checks if the cached version is the latest one.
So it should be something like
with:
node-version: ${{ env.NODE_VERSION }}
check-latest: true
in this case we can leave
node-version: 18 / 16 / 14 etc.
- number, because the latest version will be checked by actions
${{ env.CHECK_LATEST }}
- we may not put true in a separate variable, because it does not expect to change
But there's a nuance here: Setting check-latest
to true
has performance implications as downloading versions of Node is slower than using cached versions.
Node 16 has reached EOL for GH Actions. This commit updates the Actions to their latest stable release, IAW recommendations.
Test lint run
``` 2023-09-25T08:42:55.5317049Z Requested labels: ubuntu-latest 2023-09-25T08:42:55.5317316Z Job defined at: jslawler/companiesdb/.github/workflows/workflow.yml@refs/heads/actions-test 2023-09-25T08:42:55.5317501Z Waiting for a runner to pick up this job... 2023-09-25T08:42:56.6894755Z Job is waiting for a hosted runner to come online. 2023-09-25T08:43:00.1196685Z Job is about to start running on the hosted runner: GitHub Actions 1 (hosted) 2023-09-25T08:43:03.6318230Z Current runner version: '2.309.0' 2023-09-25T08:43:03.6347756Z ##[group]Operating System 2023-09-25T08:43:03.6348242Z Ubuntu 2023-09-25T08:43:03.6348655Z 22.04.3 2023-09-25T08:43:03.6348923Z LTS 2023-09-25T08:43:03.6349160Z ##[endgroup] 2023-09-25T08:43:03.6349476Z ##[group]Runner Image 2023-09-25T08:43:03.6349869Z Image: ubuntu-22.04 2023-09-25T08:43:03.6350140Z Version: 20230917.1.0 2023-09-25T08:43:03.6350647Z Included Software: https://github.com/actions/runner-images/blob/ubuntu22/20230917.1/images/linux/Ubuntu2204-Readme.md 2023-09-25T08:43:03.6351262Z Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu22%2F20230917.1 2023-09-25T08:43:03.6351719Z ##[endgroup] 2023-09-25T08:43:03.6352064Z ##[group]Runner Image Provisioner 2023-09-25T08:43:03.6352397Z 2.0.299.1 2023-09-25T08:43:03.6352680Z ##[endgroup] 2023-09-25T08:43:03.6353286Z ##[group]GITHUB_TOKEN Permissions 2023-09-25T08:43:03.6354931Z Contents: read 2023-09-25T08:43:03.6355261Z Metadata: read 2023-09-25T08:43:03.6355757Z Packages: read 2023-09-25T08:43:03.6356210Z ##[endgroup] 2023-09-25T08:43:03.6359878Z Secret source: Actions 2023-09-25T08:43:03.6360363Z Prepare workflow directory 2023-09-25T08:43:03.7116402Z Prepare all required actions 2023-09-25T08:43:03.7307837Z Getting action download info 2023-09-25T08:43:03.9299380Z Download action repository 'actions/checkout@v4' (SHA:8ade135a41bc03ea155e62e844d188df1ea18608) 2023-09-25T08:43:04.2801669Z Download action repository 'actions/setup-node@v3' (SHA:5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d) 2023-09-25T08:43:04.7242356Z Complete job name: lint 2023-09-25T08:43:04.8215802Z ##[group]Run actions/checkout@v4 2023-09-25T08:43:04.8216412Z with: 2023-09-25T08:43:04.8216781Z repository: jslawler/companiesdb 2023-09-25T08:43:04.8217407Z token: *** 2023-09-25T08:43:04.8217701Z ssh-strict: true 2023-09-25T08:43:04.8218077Z persist-credentials: true 2023-09-25T08:43:04.8218490Z clean: true 2023-09-25T08:43:04.8218812Z sparse-checkout-cone-mode: true 2023-09-25T08:43:04.8219205Z fetch-depth: 1 2023-09-25T08:43:04.8219560Z fetch-tags: false 2023-09-25T08:43:04.8219856Z show-progress: true 2023-09-25T08:43:04.8220259Z lfs: false 2023-09-25T08:43:04.8220587Z submodules: false 2023-09-25T08:43:04.8220906Z set-safe-directory: true 2023-09-25T08:43:04.8221272Z ##[endgroup] 2023-09-25T08:43:05.0692197Z Syncing repository: jslawler/companiesdb 2023-09-25T08:43:05.0694322Z ##[group]Getting Git version info 2023-09-25T08:43:05.0694941Z Working directory is '/home/runner/work/companiesdb/companiesdb' 2023-09-25T08:43:05.0695864Z [command]/usr/bin/git version 2023-09-25T08:43:05.1005857Z git version 2.42.0 2023-09-25T08:43:05.1008560Z ##[endgroup] 2023-09-25T08:43:05.1024083Z Temporarily overriding HOME='/home/runner/work/_temp/5a1f345b-5ce1-4fea-999f-c46df83cd89d' before making global git config changes 2023-09-25T08:43:05.1024663Z Adding repository directory to the temporary git global config as a safe directory 2023-09-25T08:43:05.1039611Z [command]/usr/bin/git config --global --add safe.directory /home/runner/work/companiesdb/companiesdb 2023-09-25T08:43:05.1045119Z Deleting the contents of '/home/runner/work/companiesdb/companiesdb' 2023-09-25T08:43:05.1053688Z ##[group]Initializing the repository 2023-09-25T08:43:05.1057030Z [command]/usr/bin/git init /home/runner/work/companiesdb/companiesdb 2023-09-25T08:43:05.1125000Z hint: Using 'master' as the name for the initial branch. This default branch name 2023-09-25T08:43:05.1125999Z hint: is subject to change. To configure the initial branch name to use in all 2023-09-25T08:43:05.1126763Z hint: of your new repositories, which will suppress this warning, call: 2023-09-25T08:43:05.1127098Z hint: 2023-09-25T08:43:05.1127559Z hint: git config --global init.defaultBranch