newrelic / developer-website

Source code for the New Relic Developer Site.
https://developer.newrelic.com
Apache License 2.0
40 stars 114 forks source link

Tabatha/gh actions deprecations #2229

Closed tabathadelane closed 1 year ago

tabathadelane commented 1 year ago

two notable syntax changes here:

breaking changes to octokit in github-script@v5: https://github.com/actions/github-script#breaking-changes-in-v5 https://octokit.github.io/rest.js/v19#repos-update-branch-protection

// old
 github.repos.updateBranchProtection
// new
 github.rest.repos.updateBranchProtection

actions/setup-node@v3 now has build in cache features: https://stackoverflow.com/a/62244232 https://github.com/actions/setup-node/blob/main/action.yml#L24

// old
with:
          node-version: 17

      - name: Get yarn cache directory path
        id: yarn-cache-dir-path
        run: echo "::set-output name=dir::$(yarn cache dir)"

      - uses: actions/cache@v2
        id: yarn-cache
        with:
          path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
          key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
          restore-keys: |
            ${{ runner.os }}-yarn-

we are using this setup in many places within our workflows, but the $(yarn cache dir) syntax is what throws errors with the version update, so places with that usage are the only ones i've updated for now.

// new
with:
          node-version: 17
          cache: 'yarn'

workflows running on v3

testing here: https://github.com/newrelic/developer-website/pull/2232

gatsby-cloud[bot] commented 1 year ago

:white_check_mark: developer-website-develop deploy preview ready

nr-opensource-bot commented 1 year ago

:tada: This PR is included in version 1.96.3 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: