# fullPage.js Update Workflows

This directory contains GitHub Actions workflows that automatically check for and update the fullPage.js dependency in the react-fullpage wrapper.

## Workflows

### 1. `check-fullpage-update.yml` - Automatic Daily Check
- **Schedule**: Runs daily at 2 AM UTC
- **Manual Trigger**: Available via workflow_dispatch
- **Purpose**: Automatically checks for fullPage.js updates and creates pull requests

**Features:**
- Compares current vs latest fullPage.js version
- Updates package.json if newer version available
- Increments package version
- Builds the project
- Creates a new branch and commits changes
- Creates a pull request for review
- Uses basic version comparison

### 2. `manual-fullpage-check.yml` - Manual Check with Dry Run
- **Schedule**: Manual trigger only
- **Purpose**: Safe manual checking with dry run capability

**Features:**
- Dry run mode to test updates without committing
- Creates GitHub issues for manual review
- Tests build with latest version
- Reverts changes after testing
- Safe for manual verification

### 3. `robust-fullpage-update.yml` - Robust Automatic Update
- **Schedule**: Runs daily at 3 AM UTC
- **Manual Trigger**: Available with force update option
- **Purpose**: More robust automatic updates with better error handling

**Features:**
- Uses proper semantic versioning comparison
- Force update option for manual triggers
- Better error handling and notifications
- Comprehensive logging
- Creates pull requests for review
- More detailed PR descriptions

## How to Use

### Automatic Updates
The workflows will run automatically on schedule and create pull requests for review. No direct pushes to main.

### Manual Triggers

1. **Check for updates (safe):**
   - Go to Actions tab
   - Select "Manual fullPage.js Version Check"
   - Click "Run workflow"
   - Set dry_run to true (default)

2. **Force update:**
   - Go to Actions tab
   - Select "Robust fullPage.js Update Check"
   - Click "Run workflow"
   - Set force_update to true if needed

### Monitoring

- Check the Actions tab to see workflow runs
- Look for pull requests with "fullpage-update" label
- Review and merge PRs when ready

## Configuration

### Required Secrets
- `GITHUB_TOKEN` (automatically provided by GitHub)

### Dependencies
- Node.js 18
- npm

### Permissions
The workflows require write permissions to:
- Repository contents
- Issues
- Pull requests

## Version Comparison Logic

1. **Current version**: Extracted from `package.json` dependencies
2. **Latest version**: Fetched from npm registry
3. **Comparison**: Uses semantic versioning rules
4. **Update decision**: Only updates if latest > current

## Pull Request Process

When an update is needed:
1. Update fullPage.js dependency
2. Increment package version (patch)
3. Build project
4. Create new branch with changes
5. Create pull request for review
6. Assign to maintainers for review

## Troubleshooting

### Common Issues

1. **Build failures**: Check if new fullPage.js version has breaking changes
2. **Permission errors**: Ensure GITHUB_TOKEN has proper permissions
3. **PR creation failures**: Check if branch already exists

### Manual Override

If automatic updates fail:
1. Run manual check workflow
2. Review the generated issue
3. Test locally if needed
4. Use force update option if necessary

## Labels

The workflows use these labels:
- `fullpage-update`: For PRs about fullPage.js updates
- `dependencies`: For dependency-related changes

## Contributing

To modify these workflows:
1. Test changes in a fork first
2. Use dry run mode for testing
3. Update this README if workflow behavior changes 