Skip to content

Authentication failure when using in GitHub Action on Linux agent #21

@flcdrg

Description

@flcdrg

I'm using this module as a step in a GitHub Action workflow.

      - name: Queue build
        env:
          AZURE_DEVOPS_TOKEN: ${{ secrets.AZURE_DEVOPS_TOKEN }}
        shell: pwsh
        run: |
          Install-Module AzurePipelinesPS -Repository PSGallery -Force
          Import-Module AzurePipelinesPS

          $secureToken = ConvertTo-SecureString -String $env:AZURE_DEVOPS_TOKEN -AsPlainText

          Get-APBuildDefinition -Project MyProject -Collection MyCollection -PersonalAccessToken $secureToken -Instance 'https://dev.azure.com/' -ApiVersion '6.0' -DefinitionID 1 -Verbose

If the job that this step runs in has runs-on: ubuntu-latest, then the Get-APBuildDefinition fails (returns the standard html text saying you need to log in).

If I set runs-on: windows-latest then the call succeeds.

Not sure why a Linux runner would cause it to fail

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions