Skip to content

Commit

Permalink
Add action
Browse files Browse the repository at this point in the history
  • Loading branch information
meanmail committed Oct 19, 2023
1 parent 434cc19 commit 196c26b
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
# hyperskill-azure-login
Hyperskill GitHub Action | Azure Install and login

```yaml
- uses: actions/hyperskill-azure-login@v1
with:
client_id: ${{ secrets.CLIENT_ID }}
client_secret: ${{ secrets.CLIENT_SECRET }}
subscription_id: ${{ secrets.SUBSCRIPTION_ID }}
tenant_id: ${{ secrets.TENANT_ID }}
```
41 changes: 41 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: 'Login to Azure'
description: 'Install azure cli and login to Azure'

inputs:
client_id:
required: true
description: Azure client id
client_secret:
required: true
description: Azure client secret
subscription_id:
required: true
description: Azure subscription id
tenant_id:
required: true
description: Azure tenant id

runs:
using: "composite"
steps:
- name: Install Azure cli
run: |
sudo apt-get install -y \
ca-certificates \
curl \
apt-transport-https \
lsb-release \
gnupg \
software-properties-common
curl -sL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/microsoft.gpg > /dev/null
AZ_REPO=$(lsb_release -cs)
echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $AZ_REPO main" | sudo tee /etc/apt/sources.list.d/azure-cli.list
sudo apt-get update
sudo apt-get install -y \
azure-cli
shell: bash

- name: Azure Login
uses: azure/login@v1
with:
creds: '{"clientId":"${{ inputs.client_id }}","clientSecret":"${{ inputs.client_secret }}","subscriptionId":"${{ inputs.subscription_id }}","tenantId":"${{ inputs.tenant_id }}"}'

0 comments on commit 196c26b

Please sign in to comment.