Skip to content

Commit d82a41e

Browse files
committed
Add docs
1 parent 8e575aa commit d82a41e

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ Follow the next steps to get the URL and SAS token:
9292
- Create a new container. Set the access level to **Blob (anonymous read access for blobs only)**
9393
- Open the container, and click on **Shared access signature**
9494
- Create a new shared access signature with the following settings:
95-
- Allowed permissions: **Add**
95+
- Allowed permissions: **Create**
9696
- Expiry time: **Custom** (set the time you want)
9797
- Allowed protocols: **HTTPS only**
9898
- Click on **Generate SAS and URL**

src/utils/blobServices/uploadToAzure.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,17 @@ export const uploadToAzure = async (
2323
for (const attachment of attachments) {
2424
try {
2525
if (attachment.path) {
26+
const githubRunId = process.env.GITHUB_RUN_ID || "";
2627
const parsedFile = parse(attachment.path);
27-
const fileUrl = `${azureContainerUrl}/${
28-
parsedFile.name
29-
}_${Date.now()}${parsedFile.ext}`;
28+
let fileUrl = `${azureContainerUrl}`;
29+
30+
if (githubRunId) {
31+
fileUrl = `${fileUrl}/${githubRunId}`;
32+
}
33+
34+
fileUrl = `${fileUrl}/${parsedFile.name}_${Date.now()}${
35+
parsedFile.ext
36+
}`;
3037

3138
const putResponse = await fetch(`${fileUrl}?${azureContainerSas}`, {
3239
method: "PUT",

0 commit comments

Comments
 (0)