xo-energy / action-octopus-build-information

GitHub Action that generates build information for Octopus Deploy
ISC License
4 stars 4 forks source link

Warning: Failed to fetch Octopus project: No project named 'x' was found #23

Closed dapperdandev closed 2 years ago

dapperdandev commented 2 years ago

All other Octo steps work just fine with my configuration. I tried with and w/o quotes around project names. Neither does the trick.

Could spaces in project names be causing issues?

# ci.yml
name: CI
on:
  workflow_dispatch:
  release:
    types: [ created ]

jobs:
  ci_user:
    uses: ./.github/workflows/ci-shared.yml
    with:
      APP_NAME: user
      OCTOPUS_DEPLOY_TO: "Integration"
      OCTOPUS_PROJECT: "Kno2 Web - User"
      OCTOPUS_TENANT: "Central US"
    secrets:
      OCTOPUSSERVERAPIKEY: ${{ secrets.OCTOPUSSERVERAPIKEY }}
      OCTOPUSSERVERURL: ${{ secrets.OCTOPUSSERVERURL }}
# ci-shared.yml
name: Build and Deploy

on:
  workflow_call:
    inputs:
      APP_NAME:
        required: true
        type: string
      OCTOPUS_DEPLOY_TO:
        required: true
        type: string
      OCTOPUS_PROJECT:
        required: true
        type: string
      OCTOPUS_TENANT:
        required: true
        type: string

    secrets:
      OCTOPUSSERVERAPIKEY:
        required: true
      OCTOPUSSERVERURL:
        required: true

jobs:
  build:
    runs-on: ubuntu-latest

    ...

     - name: Generate Octopus Deploy build information
        uses: xo-energy/action-octopus-build-information@v1.0.0
        with:
          octopus_api_key: ${{ secrets.OCTOPUSSERVERAPIKEY }}
          octopus_server: ${{ secrets.OCTOPUSSERVERURL }}
          octopus_project: ${{ inputs.OCTOPUS_PROJECT }}
          output_path: octo
          push_package_ids: ${{ inputs.OCTOPUS_PROJECT }}
          push_version: ${{ env.PACKAGE_VERSION }} # Set in an earlier step
dapperdandev commented 2 years ago

Discovered the issue is that the request to get projects only returns the first page. We're not as organized as we should be and all of our projects sit in one space. Our project is returned when we provide ?take=50 to the api request to get all of our projects.

It looks like this was partially built in your action, but there isn't a way to pass a query string in. I'll open up a PR. I have most of the code written, but I'll verify it first.