Hi, I have a github workflow which creates release in Octopus, since we started to use configuration as code
feature, we need to support both versions of this step, for new type of octopus project and old one, like in code below(part of bigger workflow):
- name: Create Octopus release
uses: OctopusDeploy/create-release-action@v3
if: ${{ env.OCTOPUS_IS_GIT_ENABLED_PROJECT == 'false' }}
with:
project: ${{ steps.setup.outputs.project }}
channel: ${{ inputs.octopus-channel }}
release_number: "${{ env.RELEASE_VERSION }}"
packages: ${{ format(steps.setup.outputs.packages, '\n') }}
server: ${{ inputs.octopus-server }}
space: ${{ inputs.octopus-space-name }}
api_Key: ${{ secrets.octopus-api-key }}
release_notes: '${{ env.CI_MD_BUILD_LINK }}:${{ env.RELEASE_VERSION }}'
- name: Create Octopus release
uses: OctopusDeploy/create-release-action@v3
if: ${{ env.OCTOPUS_IS_GIT_ENABLED_PROJECT == 'true' }}
with:
project: ${{ steps.setup.outputs.project }}
channel: ${{ inputs.octopus-channel }}
git_ref: ${{ github.ref }}
release_number: "${{ env.RELEASE_VERSION }}"
packages: ${{ format(steps.setup.outputs.packages, '\n') }}
server: ${{ inputs.octopus-server }}
space: ${{ inputs.octopus-space-name }}
api_Key: ${{ secrets.octopus-api-key }}
release_notes: '${{ env.CI_MD_BUILD_LINK }}:${{ env.RELEASE_VERSION }}'
As you can see the only difference is in
git_ref: ${{ github.ref }}
I tried to merge both steps and set the value of git_ref
depending of the env.OCTOPUS_IS_GIT_CONTROLLED_PROJECT
value, like below :
git_ref: ${{ env.OCTOPUS_IS_GIT_CONTROLLED_PROJECT == 'true' && github.ref }}
but anyway show an error:
Error: Error: Since the provided project is not a version controlled project, the GitCommit and GitRef arguments are not supported for this command.
Could you confirm that I need to use both version of the step or please suggest how can I merge them with supporting both types of the project