Skip to content

Commit f021a15

Browse files
authored
Merge pull request #5 from armhil/main
Updating release
2 parents 052c24f + c6996ba commit f021a15

File tree

4,930 files changed

+1573
-566004
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

4,930 files changed

+1573
-566004
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/node_modules
2+
/coverage
3+
/dist

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"git.ignoreLimitWarning": true
3+
}

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ See the `directoriesToUpload` parameter, which supports passing multiple directo
1919
uses: armhil/azure-blobs-content-uploader@1.0.0
2020
with:
2121
azureBlobConfiguration: ${{ secrets.AZ_BLOB_CONFIGURATION }} # could be any secret that you have, see below for the format
22-
directoriesToUpload: '[{"path": "test/integrationtest-directory", "shouldRecurse": "true", "baseContainerPath": "somePath" }]'
22+
directoriesToUpload: '[{"directoryToUpload": "test/integrationtest-directory", "shouldRecurse": "true", "baseContainerPath": "somePath" }]'
2323
```
2424
2525
### Azure blob details
@@ -30,7 +30,7 @@ The content uploader supports uploading to multiple storage accounts, so you're
3030
uses: armhil/azure-blobs-content-uploader@1.0.0
3131
with:
3232
azureBlobConfiguration: ${{ secrets.AZ_BLOB_CONFIGURATION }} # could be any secret that you have, see below for the format
33-
directoriesToUpload: '[{"path": "test/integrationtest-directory", "shouldRecurse": "true", "baseContainerPath": "somePath" }]'
33+
directoriesToUpload: '[{"directoryToUpload": "test/integrationtest-directory", "shouldRecurse": "true", "baseContainerPath": "somePath" }]'
3434
```
3535
3636
You should use the below format for the `azureBlobConfiguration` parameter and this value should come from the secrets. **azureBlobConfiguration parameter is expected to contain the connection strings to blob storage accounts, so it's incredibly important to store it in github repository secrets, rather than some plaintext mechanism**.
@@ -41,13 +41,12 @@ You should use the below format for the `azureBlobConfiguration` parameter and t
4141
{
4242
"connectionString": string, // Az Blobs connection string
4343
"container": string, // Container to upload the files to
44-
"path" : string // Path in the container that the files will get uploaded to
4544
},
4645
]
4746
4847
// Example secret value
4948
[{"connectionString": "DefaultEndpointsProtocol=https;AccountName=azblobuploadtest;AccountKey=someAccountKeyNotReal;EndpointSuffix=core.windows.net
50-
", "container": "$web", "path": "" }]
49+
", "container": "$web"}]
5150
```
5251

5352
*Hint*: If you're uploading some static content for web-apps (like artifacts of create-react-app) - you can use the `$web` container from Azure Blob Storage.

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ inputs:
1313
required: true
1414
runs:
1515
using: 'node16'
16-
main: 'index.js'
16+
main: 'dist/index.js'

index.js

Lines changed: 0 additions & 33 deletions
This file was deleted.

index.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import * as core from '@actions/core';
2+
import { getFilesForUpload } from './src/file-system-utils';
3+
import { uploadAll } from './src/azure-upload-utils';
4+
import { LocalFileMapping, JobParamAzureUploadConfiguration, JobParamDirectoryUpload } from './src/types';
5+
6+
try {
7+
/**
8+
* File types to upload should look like
9+
* { ".html": "text/html" }
10+
*/
11+
const fileTypesToUpload = JSON.parse(core.getInput('fileTypesToUpload'));
12+
/**
13+
* Directories to upload should look like
14+
* [
15+
* { directoryToUpload: "", shouldRecurse: "", baseContainerPath: "" }
16+
* ]
17+
*/
18+
const directoriesToUpload: JobParamDirectoryUpload = JSON.parse(core.getInput('directoriesToUpload')) || [];
19+
let filesToUpload: Array<LocalFileMapping> = [];
20+
directoriesToUpload.forEach(t => {
21+
filesToUpload = filesToUpload.concat(getFilesForUpload(t.directoryToUpload, t.shouldRecurse, t.baseContainerPath, Object.keys(fileTypesToUpload)));
22+
});
23+
/**
24+
* Azure Blob Configurations should look like
25+
* [
26+
* { connectionString: "", container: "" }
27+
* ]
28+
*/
29+
const azureBlobConfiguration: JobParamAzureUploadConfiguration = JSON.parse(core.getInput('azureBlobConfiguration'));
30+
uploadAll(azureBlobConfiguration, filesToUpload, fileTypesToUpload);
31+
}
32+
catch (error) {
33+
core.setFailed(error.message);
34+
}

jest.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
preset: "ts-jest",
3+
testEnvironment: "node"
4+
};

node_modules/.bin/browserslist

Lines changed: 0 additions & 15 deletions
This file was deleted.

node_modules/.bin/browserslist-lint

Lines changed: 0 additions & 15 deletions
This file was deleted.

node_modules/.bin/browserslist-lint.cmd

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)