Skip to content

Commit

Permalink
add login.
Browse files Browse the repository at this point in the history
  • Loading branch information
VJalili committed Jul 2, 2024
1 parent 38fa4fd commit f54aa64
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 5 deletions.
29 changes: 25 additions & 4 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ on:
- dev

jobs:
test_action:
compile_action:
runs-on: ubuntu-22.04
name: Test Action
environment: CoA
name: Compile
steps:
- name: Checkout Code
uses: actions/checkout@v3
Expand All @@ -27,11 +26,33 @@ jobs:
run: |
npm i -g @vercel/ncc
ncc build index.js --license licenses.txt
run_action:
runs-on: ubuntu-22.04
name: Run
environment: CoA
permissions:
id-token: write
contents: write
steps:
- name: Checkout Code
uses: actions/checkout@v3
- uses: actions/setup-node@v4
with:
node-version: '18.x'
- name: Install Dependencies
run: npm install
- name: Azure Login
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: Test Run
env:
INPUT_AZURE_STORAGE_ACCOUNT_NAME: ${{ vars.AZURE_STORAGE_ACCOUNT_NAME }}
INPUT_AZURE_STORAGE_CONTAINER_NAME: ${{ vars.AZURE_STORAGE_CONTAINER_NAME }}
INPUT_AZURE_STORAGE_INPUTS_CONTAINER_NAME: ${{ vars.AZURE_STORAGE_INPUTS_CONTAINER_NAME }}
INPUT_AZURE_STORAGE_BLOB_NAME: ${{ vars.AZURE_STORAGE_BLOB_NAME }}
run: |
node tests/test.js
node tests/test.js
5 changes: 4 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,10 @@ npm install
# Set up CI/CD on your own fork

1. Create a Github environment named `CoA`.
2. Define the following environment variables.
2. Follow [this](https://github.com/Azure/login?tab=readme-ov-file#login-with-openid-connect-oidc-recommended)
documentation to setup Azure Login secrets.
3. Give the service principal the `Storage Blob Data Contributor` role.
4. Define the following environment variables.

```shell
AZURE_STORAGE_ACCOUNT_NAME
Expand Down

0 comments on commit f54aa64

Please sign in to comment.