Skip to content

Commit f740770

Browse files
authored
Update main.yml
1 parent c390e03 commit f740770

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

.github/workflows/main.yml

+10-6
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ jobs:
145145
runs-on: ubuntu-latest
146146
environment: QA
147147
needs: [Build, Testing]
148+
env:
149+
cosmoskey: ::add-mask::${{ steps.arm_deployment.outputs.cosmosDBkey }}
148150
steps:
149151
- name: Repository checkout
150152
uses: actions/checkout@v4
@@ -181,7 +183,7 @@ jobs:
181183
async function createSP() {
182184
const { CosmosClient } = require("@azure/cosmos");
183185
const endpoint = "${{ steps.arm_deployment.outputs.cosmosDBendpoint }}";
184-
const key = "::add-mask::${{ steps.arm_deployment.outputs.cosmosDBkey }}";
186+
const key = "${{ env.cosmoskey }} ";
185187
const client = new CosmosClient({ endpoint, key });
186188
const { database } = await client.databases.createIfNotExists({ id: 'SampleDatabase' });
187189
const { container } = await database.containers.createIfNotExists({ id: 'WebAppContext' });
@@ -212,7 +214,7 @@ jobs:
212214
async function createTrigger() {
213215
const { CosmosClient } = require("@azure/cosmos");
214216
const endpoint = "${{ steps.arm_deployment.outputs.cosmosDBendpoint }}";
215-
const key = "::add-mask::${{ steps.arm_deployment.outputs.cosmosDBkey }}";
217+
const key = "${{ env.cosmoskey }}";
216218
const client = new CosmosClient({ endpoint, key });
217219
const { database } = await client.databases.createIfNotExists({ id: 'SampleDatabase' });
218220
const { container } = await database.containers.createIfNotExists({ id: 'WebAppContext' });
@@ -258,6 +260,8 @@ jobs:
258260
runs-on: ubuntu-latest
259261
environment: Production
260262
needs: QA
263+
env:
264+
cosmoskey: ::add-mask::${{ steps.arm_deployment.outputs.cosmosDBkey }}
261265
steps:
262266
- name: Repository checkout
263267
uses: actions/checkout@v4
@@ -294,7 +298,7 @@ jobs:
294298
async function createSP() {
295299
const { CosmosClient } = require("@azure/cosmos");
296300
const endpoint = "${{ steps.arm_deployment.outputs.cosmosDBendpoint }}";
297-
const key = "::add-mask::${{ steps.arm_deployment.outputs.cosmosDBkey }}";
301+
const key = "${{ env.cosmoskey }}";
298302
const client = new CosmosClient({ endpoint, key });
299303
const { database } = await client.databases.createIfNotExists({ id: 'SampleDatabase' });
300304
const { container } = await database.containers.createIfNotExists({ id: 'WebAppContext' });
@@ -321,8 +325,8 @@ jobs:
321325
async function createTrigger() {
322326
const { CosmosClient } = require("@azure/cosmos");
323327
const endpoint = "${{ steps.arm_deployment.outputs.cosmosDBendpoint }}";
324-
const key = "::add-mask::${{ steps.arm_deployment.outputs.cosmosDBkey }}";
325-
const client = new CosmosClient({ endpoint, key });
328+
const key = "${{ env.cosmoskey }}";
329+
const client = new CosmosClient({ endpoint, key });
326330
const { database } = await client.databases.createIfNotExists({ id: 'SampleDatabase' });
327331
const { container } = await database.containers.createIfNotExists({ id: 'WebAppContext' });
328332
const { sampleTrigger } = require('./Triggers/SampleTrigger.js')
@@ -351,4 +355,4 @@ jobs:
351355
uses: azure/webapps-deploy@v2
352356
with:
353357
app-name: ${{ steps.arm_deployment.outputs.webappname }}
354-
package: SampleApp
358+
package: SampleApp

0 commit comments

Comments
 (0)