{"id":28343383,"url":"https://github.com/dartilesm/vercel-blob-action","last_synced_at":"2025-06-12T22:03:46.540Z","repository":{"id":295346196,"uuid":"989851209","full_name":"dartilesm/vercel-blob-action","owner":"dartilesm","description":"Automates the process of uploading files or folders to Vercel Blob Storage during CI/CD workflows. It supports both single and recursive directory uploads, making it useful for deploying assets, backups, or build artifacts to Vercel Blob.","archived":false,"fork":false,"pushed_at":"2025-05-27T01:37:29.000Z","size":633,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-03T16:38:37.284Z","etag":null,"topics":["actions","backup","blob-storage","cloud","github-actions","javascript","objectstorage","objectstore-database","sdk","storage","vercel","vercel-blob","vercel-blob-storage"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dartilesm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-25T00:50:00.000Z","updated_at":"2025-05-27T01:37:32.000Z","dependencies_parsed_at":"2025-05-26T12:33:18.632Z","dependency_job_id":null,"html_url":"https://github.com/dartilesm/vercel-blob-action","commit_stats":null,"previous_names":["dartilesm/vercel-blob-action"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dartilesm/vercel-blob-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dartilesm%2Fvercel-blob-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dartilesm%2Fvercel-blob-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dartilesm%2Fvercel-blob-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dartilesm%2Fvercel-blob-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dartilesm","download_url":"https://codeload.github.com/dartilesm/vercel-blob-action/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dartilesm%2Fvercel-blob-action/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259539025,"owners_count":22873332,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["actions","backup","blob-storage","cloud","github-actions","javascript","objectstorage","objectstore-database","sdk","storage","vercel","vercel-blob","vercel-blob-storage"],"created_at":"2025-05-27T07:00:00.130Z","updated_at":"2025-06-12T22:03:46.532Z","avatar_url":"https://github.com/dartilesm.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Upload to Vercel Blob\n\nThis GitHub Action allows you to upload files or entire folders to Vercel Blob storage by specifying a source path and destination path. It provides an easy way to manage blob storage in your Vercel projects through GitHub Actions workflows.\n\n## Inputs\n\n### `source`\n\n**Required** The source path of the file or folder you want to upload to Vercel Blob storage.\n\n- **File**: Upload a single file\n- **Folder**: Upload all files within the folder (including subdirectories)\n\n### `destination`\n\n**Required** The destination path where the file(s) should be stored in Vercel Blob storage.\n\n- **For files**: The exact destination path for the file\n- **For folders**: The base path where all files will be uploaded (maintaining folder structure)\n\n### `read-write-token`\n\n**Required** Your Vercel Blob read-write token (`BLOB_READ_WRITE_TOKEN`). This should be stored as a GitHub secret for security.\n\n## Outputs\n\nThis action does not provide any outputs for privacy and security reasons. To access your uploaded files, check your Vercel dashboard under Storage → Blob.\n\n## Environment Variables\n\nThis action requires a Vercel Blob read-write token. The action will automatically set the `BLOB_READ_WRITE_TOKEN` environment variable for the Vercel Blob SDK to use. You can obtain this token from your Vercel dashboard:\n\n1. Go to your Vercel dashboard\n2. Navigate to Storage → Blob\n3. Create or copy your `BLOB_READ_WRITE_TOKEN`\n4. Add it as a GitHub secret in your repository\n\n## Usage\n\n### Single File Upload\n\nUpload a single file to Vercel Blob storage:\n\n```yaml\nname: Upload Single File\n\non:\n  push:\n    branches: [main]\n\njobs:\n  upload-file:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout code\n        uses: actions/checkout@v4\n\n      - name: Upload file to Vercel Blob\n        uses: dartilesm/vercel-blob-action@v2\n        with:\n          source: \"path/to/file.txt\"\n          destination: \"uploads/file.txt\"\n          read-write-token: ${{ secrets.BLOB_READ_WRITE_TOKEN }}\n```\n\n### Folder Upload\n\nUpload an entire folder (including subdirectories) to Vercel Blob storage:\n\n```yaml\nname: Upload Build Folder\n\non:\n  push:\n    branches: [main]\n\njobs:\n  build-and-upload:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout code\n        uses: actions/checkout@v4\n\n      - name: Build project\n        run: |\n          # Your build commands here\n          mkdir -p dist/assets\n          echo \"Main file\" \u003e dist/index.html\n          echo \"Stylesheet\" \u003e dist/assets/style.css\n          echo \"Script\" \u003e dist/assets/script.js\n\n      - name: Upload entire build folder to Vercel Blob\n        uses: dartilesm/vercel-blob-action@v2\n        with:\n          source: \"dist/\"\n          destination: \"builds/${{ github.sha }}\"\n          read-write-token: ${{ secrets.BLOB_READ_WRITE_TOKEN }}\n```\n\nThis will upload all files maintaining the folder structure:\n\n- `dist/index.html` → `builds/{sha}/index.html`\n- `dist/assets/style.css` → `builds/{sha}/assets/style.css`\n- `dist/assets/script.js` → `builds/{sha}/assets/script.js`\n\n## Setting up the Token\n\n1. **Get your Vercel Blob token:**\n\n   - Visit your [Vercel dashboard](https://vercel.com/dashboard)\n   - Go to Storage → Blob\n   - Create or copy your `BLOB_READ_WRITE_TOKEN`\n\n2. **Add the token to GitHub Secrets:**\n   - Go to your GitHub repository\n   - Navigate to Settings → Secrets and variables → Actions\n   - Click \"New repository secret\"\n   - Name: `BLOB_READ_WRITE_TOKEN`\n   - Value: Your Vercel Blob token\n\n## Development\n\nThis action is built with TypeScript and uses a build process to bundle all dependencies into a single JavaScript file. This means consumers don't need to install dependencies when using the action.\n\n### Prerequisites\n\n- Node.js 20 or later\n- npm or bun\n\n### Setup\n\n1. Clone the repository:\n\n   ```bash\n   git clone https://github.com/dartilesm/vercel-blob-action.git\n   cd vercel-blob-action\n   ```\n\n2. Install dependencies:\n   ```bash\n   npm install\n   # or\n   bun install\n   ```\n\n### Building\n\nThe action uses TypeScript and needs to be built before it can be used:\n\n```bash\nnpm run build\n# or\nbun run build\n```\n\nThis command:\n\n1. Compiles TypeScript to JavaScript (`tsc`)\n2. Bundles all dependencies into a single file using `@vercel/ncc`\n3. Outputs the bundled file to `dist/index.js`\n\n### Development Workflow\n\n1. Make changes to `src/index.ts`\n2. Commit your changes (the pre-commit hook will automatically build and stage the dist files)\n3. Test the action locally or in a workflow\n\n**Note:** A pre-commit hook automatically runs `npm run build` and stages the built files, ensuring the `dist/` directory is always in sync with your source code.\n\n### Scripts\n\n- `npm run build` - Build the action for production\n- `npm run dev` - Watch mode for development (TypeScript compilation only)\n\n### Project Structure\n\n```\n├── src/\n│   └── index.ts          # Main action source code\n├── dist/\n│   ├── index.js          # Built and bundled action (committed)\n│   └── index.js.map      # Source map for debugging\n├── action.yml            # Action metadata\n├── package.json          # Dependencies and scripts\n└── tsconfig.json         # TypeScript configuration\n```\n\n**Note:** The `dist/` directory is committed to the repository because GitHub Actions need the built JavaScript file to run the action.\n\n## License\n\nThis project is licensed under the ISC License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdartilesm%2Fvercel-blob-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdartilesm%2Fvercel-blob-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdartilesm%2Fvercel-blob-action/lists"}