Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Script to delete old GitHub Actions artifacts from the 'user/repo' repository | |
| const githubToken = 'github_pat_xxxxxxx'; // Replace with your GitHub token | |
| const headers = { | |
| 'Accept': 'application/vnd.github.v3+json', | |
| 'Authorization': `Bearer ${githubToken}`, | |
| 'User-Agent': 'ArtifactsCleaner/1.0' | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { writeFile, type WriteFileOptions } from '@tauri-apps/plugin-fs' | |
| export async function writeFileFromStream( | |
| path: string | URL, | |
| stream: ReadableStream<Uint8Array>, | |
| options?: WriteFileOptions & { chunkSize?: number } | |
| ) { | |
| const chunkSize = options?.chunkSize ?? 1024 * 1024 // 1MB in bytes | |
| const reader = stream.getReader() |
OlderNewer