microsoft / github-actions-for-desktop-apps

This repo contains a sample WPF application to demonstrate how to create CI/CD pipelines using GitHub Actions.
MIT License
353 stars 109 forks source link

CI-CD Builds Fail Due to AddPath being Deprecated #35

Closed LanceMcCarthy closed 3 years ago

LanceMcCarthy commented 3 years ago

Problem

When running any of the workflows, they will fail due to new restrictions implemented on GitHub Actions Runners. See GitHub runner Deprecating AddPath and SetEnv.

In this case, NerdBankVersioning will hit the error first, but there are other steps that have issues, too.

The `add-path` command is disabled. Please upgrade to using Environment Files or opt into unsecure command execution by setting the `ACTIONS_ALLOW_UNSECURE_COMMANDS` environment variable to `true`. For more information see: https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/

Solution Options

  1. Add an environment variable to the top of the pipeline to allow these variables to be set (easiest)
  2. Investigate all the GH Actions being used in the workflow and see if they have an update available that addresses the restriction.

Option 1 is recommended to get the pipeline working again ASAP. Then you can work on moving to Option 2 over time as you find updated Actions to migrate to.

I will open a Pull Request to get Option 1 implemented. for option 2 will take a little more time, but I wil work on it and open a follow up Pull Request once it's working w/out Option 1

LanceMcCarthy commented 3 years ago

Updating Nerdbank.GitVersioning to use v.0.3 or later doesn't resolve the issue. We need to wait for v 0.4 to get released. See https://github.com/dotnet/nbgv/issues/33.

In the meantime Option 1 is the only solution. I have confirmed it works in my fork, therefore I have opened a PR with the temporary workaround.

LanceMcCarthy commented 3 years ago

Fixed in #36