wpengine / github-action-wpe-site-deploy

A GitHub Action to deploy code directly to WP Engine.
MIT License
173 stars 36 forks source link

[CICD-606] Update actions/checkout@v4, node v20 #98

Closed mike-day closed 2 months ago

mike-day commented 2 months ago

JIRA Ticket

CICD-606

What Are We Doing Here

GHA currently uses an older version of both actions/checkout and Node. This PR updates to the newest versions we can use for both (considering transitive dependencies).

To install Node v20 using nvm, follow these steps:

Testing

Effectively testing compatibility for these dependency updates locally was tricky, but I was able to confirm several workflows ran checkout@v4 without errors.

Test e2e Deploy to WP Engine

act push -j run_action

Lint GHA Files

act push -j lint

The image used with act does not contain some packages available by default with GitHub, so both shellcheck and yamllint were installed as part of the workflow locally. The YAML for the job looked like this:

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - name: Lint files
        uses: actions/checkout@v4
      - name: Update package list
        run: sudo apt-get update
      - name: Install ShellCheck
        run: sudo apt-get install -y shellcheck
      - name: Install yamllint
        run: sudo apt-get install -y yamllint
      - run: echo "Running shell script lint!"
      - run: find . -name "*.sh" -type f | xargs -I {} shellcheck --severity=error {}
      - run: echo "Running yml file lint!"
      - run: find . -name "*.yml" -type f | xargs -I {} yamllint {}

Version and Release

I couldn't figure out a great way to test this workflow locally. changesets/action expects a valid GitHub token to run, but supplying a real token could actually create a PR or release while testing, which is not ideal 😄

At one point, I did try simply commenting out the step to create a PR. checkout@v4 and setup-node@v2 both seemed to work as expected and the current version was output by the job.

changeset-bot[bot] commented 2 months ago

⚠️ No Changeset found

Latest commit: 91bf3497203b7078aae584589821c084a2ae244e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR