ConfluencePS icon indicating copy to clipboard operation
ConfluencePS copied to clipboard

Function override causes build failure

Open zbalkan opened this issue 2 years ago • 0 comments

The BuildTools.psm1 module of yours is defined in the build script. https://github.com/AtlassianPS/ConfluencePS/blob/c86f787f2ae71c935092e67f3d0c356c47212999/ConfluencePS.build.ps1#L31

Then BuildHelpers module is imported 3 lines later. https://github.com/AtlassianPS/ConfluencePS/blob/c86f787f2ae71c935092e67f3d0c356c47212999/ConfluencePS.build.ps1#L34

However they both have the same command, Publish-GithubRelease with different parameters. The first one, your custom module requires a parameter called GITHUB_ACCESS_TOKEN while the latter requires AccessToken as you can see here. And the second one is imported later with -Force parameter, it overrides the function from the first module. It is better to make a decision:

  • Keep both functions but move custom module a few lines below to override external one.
  • Remove Publish-GithubRelease from BuildTools.psm1 and use the one from BuildHelpers module.

zbalkan avatar Mar 28 '22 07:03 zbalkan