Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upload-artifact/v4 not supported on GHES #178

Open
erikvanoosten opened this issue Dec 23, 2023 · 2 comments
Open

upload-artifact/v4 not supported on GHES #178

erikvanoosten opened this issue Dec 23, 2023 · 2 comments

Comments

@erikvanoosten
Copy link

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
  }
}
@mdedetrich
Copy link
Contributor

mdedetrich commented Dec 23, 2023

Hmm, to me it sounds like the best way to solve this issue is to make an sbt setting specifically for the upload-artifact/download-artifact version so people can adjust it as they need

@erikvanoosten wdyt?

@erikvanoosten
Copy link
Author

erikvanoosten commented Dec 23, 2023

Indeed, that sound like a better idea. This can be generalized of course.

Perhaps something like:

ThisBuild / githubWorkflowStepVersions ++=
  Map("actions/upload-artifact" -> "v3", "actions/download-artifact" -> "v3")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants