Skip to content

Conversation

@svg153
Copy link
Member

@svg153 svg153 commented Oct 27, 2025

Adds a reusable GitHub Action to scrape/sync Meetup events and a workflow to run it on schedule and dispatch.

Copilot AI review requested due to automatic review settings October 27, 2025 01:42
@svg153 svg153 marked this pull request as draft October 27, 2025 01:42
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces automation to scrape and sync Meetup.com events into a JSON file. The implementation provides a reusable GitHub Action that uses Puppeteer for web scraping and Cheerio for HTML parsing, along with a scheduled workflow to run the sync daily.

Key Changes:

  • New custom GitHub Action for scraping Meetup events with configurable organization and output path
  • Scheduled workflow that runs daily at 6 AM UTC and supports manual dispatch
  • Event data includes ID, name, link, date, and images extracted from OpenGraph meta tags

Reviewed Changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
actions/sync-meetup-events/package.json Defines Node.js dependencies (Puppeteer 23.0.0, Cheerio 1.0.0)
actions/sync-meetup-events/index.js Core scraping logic with Puppeteer browser automation and image extraction
actions/sync-meetup-events/action.yml GitHub Action metadata defining inputs and Node 20 runtime
actions/sync-meetup-events/README.md Comprehensive documentation with usage examples and JSON structure
actions/sync-meetup-events/.gitignore Standard Node.js gitignore patterns
.github/workflows/sync-events.yml Workflow orchestrating the action execution with git commit automation
Files not reviewed (1)
  • actions/sync-meetup-events/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Jul: '07', Aug: '08', Sep: '09', Oct: '10', Nov: '11', Dec: '12'
};
const monthNum = monthMap[month];
const year = '2025'; // Asumir 2025
Copy link

Copilot AI Oct 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hardcoded year '2025' will cause incorrect dates once 2026 begins. The year should be determined dynamically based on the current date and the event's month/day to handle year boundaries correctly.

Suggested change
const year = '2025'; // Asumir 2025
// Determine year dynamically
const now = new Date();
const eventMonth = parseInt(monthNum, 10);
const eventDay = parseInt(day, 10);
let year = now.getFullYear();
// If event month/day is before today, assume next year
if (
eventMonth < (now.getMonth() + 1) ||
(eventMonth === (now.getMonth() + 1) && eventDay < now.getDate())
) {
year = year + 1;
}

Copilot uses AI. Check for mistakes.
await page.goto(meetupUrl, { waitUntil: 'networkidle2', timeout: 60000 });

// Esperar a que cargue
await new Promise(resolve => setTimeout(resolve, 5000));
Copy link

Copilot AI Oct 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Magic number 5000 (milliseconds) should be extracted to a named constant like PAGE_LOAD_DELAY_MS to improve code clarity and maintainability.

Copilot uses AI. Check for mistakes.
with:
json-path: 'public/data/issues.json'
meetup-org: 'ghspain'

Copy link

Copilot AI Oct 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The example references steps.verify-changed-files but the actual step ID in the workflow file is verify-changed-files. This step doesn't exist in the example workflow, causing the conditional to always evaluate as false.

Suggested change
- name: Verify changed files
id: verify-changed-files
run: |
if git diff --quiet public/data/issues.json; then
echo "changed=false" >> $GITHUB_OUTPUT
else
echo "changed=true" >> $GITHUB_OUTPUT
fi

Copilot uses AI. Check for mistakes.
@svg153
Copy link
Member Author

svg153 commented Oct 27, 2025

Resumen del último commit: afecta únicamente a .github/workflows/sync-events.yml.

¿Qué cambia y por qué:

  • Programación: ejecuta diariamente a las 06:00 UTC y permite ejecución manual (workflow_dispatch).
  • Node 20 + caché npm: usa actions/setup-node@v4 con cache: npm y cache-dependency-path apuntando a actions/sync-meetup-events/package-lock.json para instalaciones más rápidas y reproducibles.
  • Caché de Puppeteer/Chromium: persiste ~/.cache/puppeteer para evitar descargas en cada run.
  • Instalación y ejecución de la acción local: npm ci en actions/sync-meetup-events y uses: ./actions/sync-meetup-events para generar public/data/issues.json.
  • Commit condicional: solo hace commit/push si public/data/issues.json cambia, evitando commits vacíos.
  • Permisos mínimos: contents: write en el job para poder commitear cambios.

Motivación:

  • Reducir tiempos de CI con cachés (npm/Puppeteer).
  • Evitar ruido en el historial con commits vacíos.
  • Asegurar runs consistentes (Node 20 y bloqueo por package-lock.json).

Si queréis, en una iteración posterior podemos añadir protección para evitar que el job se ejecute en forks (comprobando github.repository_owner) o añadir concurrency para evitar solapamientos.

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