OctopusDeploy / create-release-action

| Public | :octocat: GitHub Action to Create a Release in Octopus Deploy

Home Page:https://github.com/marketplace/actions/create-release-in-octopus-deploy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

V2 to V3 Upgrade Issue

zengshengliu opened this issue Β· comments

I am trying to update from the v2 to v3 version of the create-release-action.
Here is my V2 config:

      - name: Install Octopus CLI πŸ™
        uses: OctopusDeploy/install-octopus-cli-action@v1
        with:
          version: 'latest'
      - name: Create Octopus Release
        uses: OctopusDeploy/create-release-action@v2
        env:
          OCTOPUS_HOST: ${{ secrets.OCTOPUS_CLI_SERVER }}
          OCTOPUS_API_KEY: ${{ secrets.OCTOPUS_APIKEY }}
          OCTOPUS_SPACE: 'Spaces-1'
        with:
          ignore_existing: true
          project: ${{ needs.names.outputs.repository_name }}
          packages: "*:${{ needs.get_version_tag.outputs.version }}"
          release_number: ${{ needs.get_version_tag.outputs.version }}

Here is my V3 config:

      - name: Create Octopus Release
        uses: OctopusDeploy/create-release-action@v3
        env:
          OCTOPUS_URL: ${{ secrets.OCTOPUS_CLI_SERVER }}
          OCTOPUS_API_KEY: ${{ secrets.OCTOPUS_APIKEY }}
          OCTOPUS_SPACE: 'Default'
        with:
          ignore_existing: true
          project: ${{ needs.names.outputs.repository_name }}
          packages: "*:${{ needs.get_version_tag.outputs.version }}"
          release_number: ${{ needs.get_version_tag.outputs.version }}

(I have to switch from space id Spaces-1 to space name Default for the OCTOPUS_SPACE, otherwise I will get the following error)

πŸ™ Creating a release in Octopus Deploy...
Error: Unable to resolve space name 'Spaces-1'
Error: Error: Unable to resolve space name 'Spaces-1'

The V2 one works without issue, but for V3, it is giving me the following error

πŸ™ Creating a release in Octopus Deploy...
Error: Error: The resource you requested was not found.

Is there something that I miss that could cause the issue?

The v3 release of this action now uses the space name (instead of its ID). Try using the name of the space and see if that works.

Hi @jbristowe
I did use the space name instead (see the v3 config which uses Default which is the name for the space id Spaces-1), but it is still giving me the error.

I enabled debug log and it shows that it was able to map from the name Default to ID Spaces-1

πŸ™ Creating a release in Octopus Deploy...
##[debug]Creating a release...
##[debug]Resolving space from name 'Default'
##[debug]Resolved space name 'Default' to Id Spaces-1
Error: Error: The resource you requested was not found.
##[debug]Node Action run completed with exit code 1
##[debug]Finishing: Create Octopus Release

Some thoughts that come to mind; the project and/or packages may not be reconciled. The error you're seeing (i.e. The resource you requested was not found.) is returned by the create-release endpoint. Can you verify the existence of the project and/or packages?

Yep, I can confirmed from the octopus UI that the project and packages exist. I even try to have both the v2 and v3 in the same github actions in two different step, and the V2 one works but not the V3 (with same variables)

Could we check which version of Octopus server you have? E.g. are you working against an Octopus cloud instance or a self hosted instance?
I think the later could cause this issue, depending on what version it is. v3 of our GitHub actions depend on some new APIs that were added in 2022.3 of Octopus. These APIs will be available in our cloud instances, but if you have an older self hosted instance that could explain this error.

I think that could be the reason. We are using a self hosted version of the octopus and it is 2021 version (2021.3.8275 to be exact).

I'm also running into this problem, V3 github action with 2021.1 server version and I'm seeing the same error.

After updating to 2022.4.8319, the v3 of the action is confirmed working.
Just wondering if it is possible to update the action so that it perform a version check of the octopus server, and provide a meaningful error message if the version is "too old" instead of resource not found.

The Octopus Github Actions steps now perform a check to ensure that the server meets the minimum version requirement for the step.