Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,9 @@ jobs:
- name: Upload Static Content
uses: armhil/azure-blobs-content-uploader@1.0.0
with:
azureBlobConfiguration: ${{ secrets.AZ_BLOB_CONFIGURATION }}
clientId: ${{ secrets.ENTRA_CLIENTID }}
clientSecret: ${{ secrets.ENTRA_CLIENTSECRET }}
tenantId: ${{ secrets.ENTRA_TENANTID }}
storageAccountsList: ${{ secrets.STORAGE_ACCOUNT_LIST }}
containerName: "$web"
directoriesToUpload: '[{"path": "test/integrationtest-directory", "shouldRecurse": "true" }]'
18 changes: 15 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
name: 'Static Content Uploader for Azure Blobs'
description: 'A useful tool for uploading CRA artifacts to Az Blobs'
inputs:
azureBlobConfiguration: # Should be a secret value, with connection strings
description: 'Azure blob configuration'
clientId: # Should be a secret value, string
description: 'Entra App App Id'
required: true
clientSecret: # Should be a secret value, string
description: 'Entra App App Id'
required: true
tenantId: # Should be a secret value, with connection strings
description: 'Entra App Tenant Id'
required: true
storageAccountList: # Could be secret but not necessarily
description: 'Storage accounts'
required: true
containerName: # Could be secret but not necessarily
description: 'Container Name'
required: true
fileTypesToUpload: # We may not want to upload all files
description: 'Our static content extensions to Content-Type may be limited for you, use this if you want to extend'
Expand All @@ -12,5 +24,5 @@ inputs:
description: 'List of directories to upload, relative paths only'
required: true
runs:
using: 'node16'
using: 'node18'
main: 'dist/index.js'
14 changes: 11 additions & 3 deletions index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as core from '@actions/core';
import { getFilesForUpload } from './src/file-system-utils';
import { uploadAll } from './src/azure-upload-utils';
import { LocalFileMapping, JobParamAzureUploadConfiguration, JobParamDirectoryUpload } from './src/types';
import { LocalFileMapping, EntraAppConfiguration, JobParamDirectoryUpload } from './src/types';

try {
/**
Expand All @@ -26,8 +26,16 @@ try {
* { connectionString: "", container: "" }
* ]
*/
const azureBlobConfiguration: JobParamAzureUploadConfiguration = JSON.parse(core.getInput('azureBlobConfiguration'));
uploadAll(azureBlobConfiguration, filesToUpload, fileTypesToUpload);
const entraAppConfiguration: EntraAppConfiguration = {
clientId: core.getInput('clientId'),
clientSecret: core.getInput('clientSecret'),
tenantId: core.getInput('tenantId')
};

const storageAccountList: Array<string> = JSON.parse(core.getInput('storageAccountList'));
const containerName = core.getInput('containerName');

uploadAll(storageAccountList, containerName, entraAppConfiguration, filesToUpload, fileTypesToUpload);
}
catch (error) {
core.setFailed(error.message);
Expand Down
Loading
Loading