The GetProjectVersion Action returns the current version of your project based on the version of a given project file. There are currently only two file types supported:
- .csproj - C-Sharp project files
- .psd1 - PowerShell Module Manifest files
You can trigger the action.yml
by workflow_call
to post a notification automatically. The workflow contains several steps to act:
- Checkout the repository
- Call the
getprojectversion.ps1
script
Filename
: If the file is in the root of the repository, it's just the filename, project.csproj. If the file is inside a folder, it's the relative path to that file, MyProject\project.psd1verbose
: A value of verbose will output additional information
The PowerShell script opens the given project file and returns the string value of the version.
There are a few different ways you could use this action; here is an example of one way to get you started.
jobs:
GetVersion:
uses: mod-posh/[email protected]
with:
Filename: '"MyModule.psd1"'
verbose: 'verbose'
Note
This example is used directly as part of a larger workflow The verbose option will output a little more detail in the logs
This project is licensed using the Gnu GPL-3.