sbt / sbt/sbt-github-actions

upload-artifact/v4 not supported on GHES

Open
#178 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Scala
Stars
199
Forks
67
Avg merge
6h 24m
Merged PRs (30d)
3

Description

Upgrading to v0.22.0 results in the following error:

@actions/artifact v2.0.0+, upload-artifact@v4+ and download-artifact@v4+ are not currently supported on GHES.

Can we downgrade to v3 until v4 works on GHES as well?

As a workaround, you can downgrade these actions to v3 with the following super ugly code in build.sbt:

// "actions/upload-artifact/v4" and " actions/download-artifact/v4" are not supported on GHES, downgrade to v3
ThisBuild / githubWorkflowGeneratedUploadSteps := {
  (ThisBuild / githubWorkflowGeneratedUploadSteps).value.map {
    case workflow: WorkflowStep.Use =>
      workflow.ref match {
        case p: UseRef.Public =>
          if (p.owner == "actions" && p.repo == "upload-artifact") workflow.copy(ref = p.copy(ref = "v3"))
          else workflow
        case _ => workflow
      }
    case w => w
  }
}
ThisBuild / githubWorkflowGeneratedDownloadSteps := {
  (ThisBuild / githubWorkflowGeneratedDownloadSteps).value.map {
    case workflow: WorkflowStep.Use =>
      workflow.ref match {
        case p: UseRef.Public =>
          if (p.owner == "actions" && p.repo == "download-artifact") workflow.copy(ref = p.copy(ref = "v3"))
          else workflow
        case _ => workflow
      }
    case w => w
  }
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the githubWorkflowGeneratedUploadSteps and githubWorkflowGeneratedDownloadSteps settings shown in build.sbt, then inspect how v0.22.0 generates artifact workflow steps. Reproduce the GHES failure if possible and verify that the generated upload-artifact and download-artifact references use v3; no specific source file or test is named in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, scala
Domain
build-system, ci-cd
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.