Azure / cli

Automate your GitHub workflows using Azure CLI scripts
MIT License
124 stars 52 forks source link

Run PowerShell scripts in GitHub actions #86

Closed fleed closed 1 year ago

fleed commented 1 year ago

It seems that the GitHub action currently supports only bash scripts. I would like to see support for PowerShell scripts (inline and files) as well.

t-dedah commented 1 year ago

Hi @fleed Actions already support powershell script by just changing the shell type.

- name: Run powershell
  shell: pwsh
  run: |
         .\build.ps1

On windows, the default is already pwsh so you wont even need to specify that.

fleed commented 1 year ago

@t-dedah could you please provide an example with az commands? Would it automatically login?

t-dedah commented 1 year ago

Hi @fleed for login we have another action that you can use

- name: Azure Login
  uses: azure/login@v1
  with:
        creds: ${{ secrets.AZURE_CREDENTIALS }}

If you can expand more on the exact requirement then we will be able to provide the exact workflow.

fleed commented 1 year ago

Thank you @t-dedah

In general I'm using PowerShell for all my scripts, so I would like to run some scripts with az commands. Executing the login as separate action should make it possible, I will try.

t-dedah commented 1 year ago

@fleed Feel free to reopen the issue