Skip to content

Commit

Permalink
fix(github-actions): matrix cannot contain secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
mildronize committed May 5, 2024
1 parent 3bd9459 commit 75fb288
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ jobs:
azcliversion: 2.58.0
inlineScript: |
cd examples/with-${{ matrix.runtime }}/.nmt/dist && \
func azure functionapp publish nmt-e2e-${{ matrix.target }}-${{ matrix.resource_identifier }}
func azure functionapp publish nmt-e2e-${{ matrix.target }}-${{ secrets[matrix.resource_identifier_key] }}
- name: Wait for the deployment to finish
run: sleep 60

- name: Run E2E tests
run: pnpm exec nx run @infra/azure-functions:test
env:
AZURE_FUNCTIONS_URL: https://nmt-e2e-${{ matrix.target }}-${{ matrix.resource_identifier }}.azurewebsites.net
AZURE_FUNCTIONS_API_KEY: ${{ secrets.AZURE_FUNCTIONS_HOST_KEY }}
AZURE_FUNCTIONS_URL: https://nmt-e2e-${{ matrix.target }}-${{ secrets[matrix.resource_identifier_key] }}.azurewebsites.net
AZURE_FUNCTIONS_API_KEY: ${{ secrets.AZURE_FUNCTIONS_HOST_KEY }}
6 changes: 3 additions & 3 deletions infra/azure-functions/src/github-actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ export interface GithubActionsMatrix {
*/
target: string;
/**
* Resource Identifier
* Resource Identifier Key for getting value from github actions secrets
*/
resource_identifier: string;
resource_identifier_key: string;
}

/**
Expand Down Expand Up @@ -51,7 +51,7 @@ export function toGithubActionsMatrix(configs: InfraEnvConfig[]): GithubActionsM
runtime: runtime === 'bun' ? 'bun' : 'node',
version,
target: toTarget(config),
resource_identifier: config.resourceIdentifier,
resource_identifier_key: `RESOURCE_IDENTIFIER_${toTarget(config).replaceAll('-', '_').toUpperCase()}`,
} satisfies GithubActionsMatrix;
});
}
Expand Down

0 comments on commit 75fb288

Please sign in to comment.