micromasters icon indicating copy to clipboard operation
micromasters copied to clipboard

Fix deprecated GitHub Actions causing workflow failures

Open Copilot opened this issue 5 months ago • 0 comments

Problem

GitHub workflows were failing with deprecated action warnings:

Error: This request has been automatically failed because it uses a deprecated version of actions/cache: v1. Please update your workflow to use v3/v4 of actions/cache to avoid interruptions.

Multiple workflows were using deprecated actions that are no longer supported.

Solution

Updated all GitHub Actions to their latest supported versions and leveraged built-in caching capabilities:

Key Changes

CI Workflow (ci.yml):

  • Updated actions/checkout@v2actions/checkout@v4
  • Updated actions/setup-python@v2actions/setup-python@v5 with built-in pip caching
  • Updated actions/setup-node@v2-betaactions/setup-node@v5 with built-in yarn caching
  • Updated codecov/codecov-action@v1codecov/codecov-action@v4
  • Removed deprecated actions/cache@v1 - replaced with native caching in setup actions
  • Fixed incorrect file reference (Aptfileapt.txt)

Deployment Workflows:

  • Updated actions/checkout@v2actions/checkout@v4 in both production.yml and release-candidate.yml

Benefits

  • Eliminates workflow failures from deprecated actions
  • Simplifies configuration by removing 22+ lines of manual cache setup
  • Improves performance with modern action caching strategies
  • Future-proofs workflows with actively maintained action versions

Before/After Comparison

Before: Manual cache configuration with deprecated actions

- uses: actions/cache@v1
  with:
    path: ~/.cache/pip
    key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
    restore-keys: |
      ${{ runner.os }}-pip-

After: Built-in caching with modern actions

- uses: actions/setup-python@v5
  with:
    python-version: "3.9.1"
    cache: 'pip'
    cache-dependency-path: |
      requirements.txt
      test_requirements.txt

All YAML syntax has been validated and security scans show no vulnerabilities. The workflows should now run reliably without deprecated action warnings.

Original prompt

This section details on the original issue you should resolve

<issue_title>Fix actions</issue_title> <issue_description>### Description/Context We need to update github workflows to not use v2 of actions/cache. Some workflows currentluyfailing with message:

Error: This request has been automatically failed because it uses a deprecated version of actions/cache: v1. Please update your workflow to use v3/v4 of actions/cache to avoid interruptions. Learn more: https://github.blog/changelog/2024-12-05-notice-of-upcoming-releases-and-breaking-changes-for-github-actions/#actions-cache-v1-v2-and-actions-toolkit-cache-package-closing-down

IMO: We should update setup-node action to v5, which should reduce the need for actions/cache, at least with regard to JS installations.

</issue_description>

<agent_instructions>Please avoid making changes unrelated to this issue.</agent_instructions>

Comments on the Issue (you are @copilot in this section)

Fixes mitodl/micromasters#5433

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot avatar Sep 25 '25 21:09 Copilot