Skip to content

Commit 1f1b8f7

Browse files
das
1 parent afca24c commit 1f1b8f7

File tree

1 file changed

+3
-20
lines changed

1 file changed

+3
-20
lines changed

.github/workflows/temp.yml

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,6 @@ jobs:
1717

1818
steps:
1919
- name: Get Artifact URL
20-
id: get-artifact-url
21-
uses: actions/github-script@v6
22-
with:
23-
script: |
24-
const downloadUrl = "https://api.github.com/repos/Kommunicate-io/Kommunicate-Android-Chat-SDK/actions/artifacts/2355441843";
25-
const fetcha = require('node-fetch'); // Available in github-script
26-
const response = await fetcha(downloadUrl, {
27-
headers: {
28-
Authorization: `token ${process.env.GITHUB_TOKEN}`,
29-
},
30-
});
31-
if (response.ok) {
32-
const buffer = await response.buffer();
33-
require('fs').writeFileSync('artifact.zip', buffer);
34-
console.log('Artifact downloaded successfully as artifact.zip');
35-
} else {
36-
console.error(`Failed to download artifact: ${response.statusText}`);
37-
}
38-
env:
39-
GITHUB_TOKEN: ${{ secrets.DOWNLOAD_TOKEN }}
20+
run:|
21+
response = $(curl -H "Authorization: token ${{ secrets.DOWNLOAD_TOKEN }}" -L "https://api.github.com/repos/Kommunicate-io/Kommunicate-Android-Chat-SDK/actions/artifacts/2355441843" -o artifact.zip)
22+
echo "response from curl= $response"

0 commit comments

Comments
 (0)