Skip to content

Conversation

@dartilesm
Copy link
Owner

Describe your changes

This PR implements a complete GitHub Action for uploading files to Vercel Blob storage. The action provides a simple interface for developers to integrate Vercel Blob uploads into their CI/CD workflows.

Key Features:

  • GitHub Action Implementation: Complete action with action.yml, Node.js source code, and proper package configuration
  • Vercel Blob SDK Integration: Uses the official @vercel/blob SDK with proper environment variable handling
  • Read-Write Token Support: Accepts BLOB_READ_WRITE_TOKEN as input and automatically sets it as an environment variable for the SDK
  • Comprehensive Documentation: Detailed README with setup instructions, usage examples, and token configuration guide
  • Sample Workflow: Complete workflow file demonstrating various use cases including:
    • Static file uploads
    • Build artifact uploads with Node.js setup
    • Conditional uploads with manual triggers
    • Error handling patterns

Technical Implementation:

  • Uses Node.js 20 with ES modules
  • Proper input validation and error handling
  • Returns blob URL as action output
  • Follows GitHub Actions best practices

Files Added/Modified:

  • action.yml - Action metadata and input/output definitions
  • src/index.js - Main action logic using Vercel Blob SDK
  • package.json - Dependencies and project configuration
  • README.md - Comprehensive documentation and examples
  • .github/workflows/upload-to-blob.yml - Sample workflow with multiple scenarios
  • .gitignore - Node.js gitignore patterns

Include a screenshot where applicable

N/A - This is a GitHub Action implementation without UI components.

Issue ticket number and link

No related issues found.

dartilesm added 8 commits May 25, 2025 01:22
…ty and functionality

- Added .gitignore to exclude .cursor files.
- Updated action.yml to include a new input for read-write token and improved descriptions for inputs and outputs.
- Modified README to clarify usage instructions and added a section for setting up the Vercel Blob token.
- Enhanced package.json with a new dependency for @vercel/blob and updated the description for better accuracy.
- Implemented a comprehensive workflow to upload static files, build artifacts, and conditionally upload files based on user input.
- Included error handling for uploads and created sample files for testing.
- Enhanced the process with clear steps for checking file existence and handling upload results.
- Changed the Node.js version from 20 to 22 in the upload-to-blob.yml workflow for improved compatibility and performance.
…ions workflow

- Replaced npm commands with bun commands in the upload-to-blob.yml workflow for improved performance and consistency.
- Added setup step for bun to ensure the environment is correctly configured.
- Modified the file upload function to include an access level parameter, setting it to 'public' for improved visibility of uploaded files.
- Added steps to install dependencies using bun in the upload-to-blob.yml workflow.
- Included setup for Node.js version 22 to ensure compatibility with the new dependency management.
@dartilesm dartilesm merged commit 34cae61 into master May 25, 2025
4 checks passed
@dartilesm dartilesm deleted the feat/vercel-blob-setup branch May 25, 2025 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants