Skip to content

release_dir implicitly required, causes issues for projects without it #125

Open

Description

@doebrowsk

Fixing issue #121 created a new issue with the release_dir field

It is now always pulled from the integration-manifest.json as of release 3.3.1, currently tagged as v3. However, this now causes issues for integrations that do not define (or need to define) that field. The action that pulls these properties from the json file needs to be updated to handle missing properties, such as allowing them to be missing unless marked required.

That action is found in this repo (forked from the original, and still referenced, action): https://github.com/Keyfactor/assign-from-json

Activity

  1. irby commented on Sep 2, 2025

    @irby

    Today I was bit by the release_project parameter defined as a non-required input (https://github.com/Keyfactor/actions/blob/main/.github/workflows/dotnet-build-and-release.yml#L20)

    In this workflow, https://github.com/Keyfactor/actions/blob/main/.github/workflows/dotnet-build-and-release.yml#L100, if this parameter is not set (empty) it will result in an Actions failure.

      [xml]$csproj = Get-Content ""
      $targetFrameworks = $csproj.Project.PropertyGroup.TargetFrameworks
      if ($null -eq $targetFrameworks) {
        $targetFrameworks = $csproj.Project.PropertyGroup.TargetFramework
      }
      echo "release_platforms: $targetFrameworks"
      echo "release_platforms=$targetFrameworks" | Out-File $env:GITHUB_ENV -Encoding utf8 -Append
      shell: C:\Program Files\PowerShell\7\pwsh.EXE -command ". '{0}'"
      env:
        DOTNET_ROOT: C:\Program Files\dotnet
        REPO_NAME: [project]
        SOLUTION_PATH: D:\a\...\[project].sln
        CREATE_RELEASE: True
        IS_PRE_RELEASE: True
    Get-Content: D:\a\_temp\86950a7a-0f73-4719-a26e-57124ecc67ea.ps1:2
    Line |
       2 |  [xml]$csproj = Get-Content ""
         |                             ~~
         | Cannot bind argument to parameter 'Path' because it is an empty string.
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions