Skip to content

Instantly share code, notes, and snippets.

@azu
Last active August 23, 2022 13:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save azu/e26943954b13f26b73d5e64010353f8b to your computer and use it in GitHub Desktop.
Save azu/e26943954b13f26b73d5e64010353f8b to your computer and use it in GitHub Desktop.
shepherd script: update ubuntu-18.04 to ubuntu-latest on GitHub Actions
id: 2022.08.23-ubuntu-18.04
title: "CI: update ubuntu-18.04 to ubuntu-latest"
adapter:
type: github
search_type: code
search_query: org:{{user}} path:/.github/workflows
hooks:
should_migrate:
- ls .github/workflows
- find .github/workflows -type f -name "*.y*ml" -exec grep "ubuntu-18.04" {} +;
apply:
- find .github/workflows -type f -name "*.y*ml" -exec sed -i "" -e "s/ubuntu-18.04/ubuntu-latest/" {} +;
pr_message: echo "ref https://github.com/actions/runner-images/issues/6002"

ubuntu-18.04 is depreacated on GitHub Actions

Migrate ubuntu-18.04 to ubuntu-latest using https://github.com/NerdWalletOSS/shepherd.

Manual Migration

Test on macOS.

Check

find .github/workflows -type f -name "*.y*ml" -exec grep "ubuntu-18.04" {} +;

Apply Migration

find .github/workflows -type f -name "*.y*ml" -exec sed -i "" -e "s/ubuntu-18.04/ubuntu-latest/" {} +;

Related

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment