Skip to content

Sync Issues: consolidate workflow using local action#18

Open
svg153 wants to merge 2 commits intomainfrom
feature/sync-issues-workflow-consolidation
Open

Sync Issues: consolidate workflow using local action#18
svg153 wants to merge 2 commits intomainfrom
feature/sync-issues-workflow-consolidation

Conversation

@svg153
Copy link
Member

@svg153 svg153 commented Oct 27, 2025

Esta PR consolida el workflow que sincroniza Issues a public/data/issues.json:\n\n- Usa Node 20 y hace npm ci en actions/sync-issue\n- Ejecuta la acción local actions/sync-issue para transformar el Issue en JSON\n- Solo hace commit si public/data/issues.json cambia\n- Replica el archivo a la rama gh-pages cuando hay cambios\n\nRazón: eliminar fragmentos duplicados y asegurar un flujo mínimo y predecible.

Copilot AI review requested due to automatic review settings October 27, 2025 02: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 consolidates the workflow that syncs GitHub Issues to public/data/issues.json by:

  • Upgrading to Node 20 and using a local action for issue synchronization
  • Adding conditional execution to only commit when the data file actually changes
  • Streamlining the git operations for both main and gh-pages branches

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

@@ -2,7 +2,7 @@ name: Sync Issues to JSON

on:
issues:
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 addition of 'labeled' and 'reopened' trigger types is undocumented in the PR description. Consider documenting why these triggers were added to help future maintainers understand the complete scope of issue events that trigger synchronization.

Suggested change
issues:
issues:
# The workflow is triggered on multiple issue events to ensure the JSON data stays in sync.
# 'labeled' is included to capture changes in issue labels, which may affect downstream processing.
# 'reopened' is included to handle issues that are reopened, ensuring their state is updated in the JSON.
# Other events ('opened', 'edited', 'closed') are standard for issue lifecycle changes.

Copilot uses AI. Check for mistakes.
Comment on lines +68 to +69
git fetch origin gh-pages || true
git checkout gh-pages || git switch -c gh-pages
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 || true on line 68 silently ignores fetch errors, which could mask legitimate issues like network failures or repository access problems. Consider checking if gh-pages exists first with git ls-remote --heads origin gh-pages and handling the branch creation case explicitly rather than suppressing all errors.

Suggested change
git fetch origin gh-pages || true
git checkout gh-pages || git switch -c gh-pages
if git ls-remote --exit-code --heads origin gh-pages; then
git fetch origin gh-pages
git checkout gh-pages
else
git switch --create gh-pages
fi

Copilot uses AI. Check for mistakes.
@svg153 svg153 force-pushed the feature/sync-issues-workflow-consolidation branch from 7dd5adb to 3dc2420 Compare October 27, 2025 02:43
@svg153
Copy link
Member Author

svg153 commented Oct 27, 2025

He eliminado el fichero scripts/sync-issue.js porque su funcionalidad quedó cubierta por la action local actions/sync-issue y la lógica principal se centralizó en actions/sync-issue/lib/core.js. Mantener ambos generaba duplicación y riesgo de divergencia. Si prefieres conservar una CLI ligera, podemos añadir un script mínimo que invoque las funciones del core, pero el archivo anterior era una copia funcional redundante.

@svg153 svg153 force-pushed the feature/sync-issues-workflow-consolidation branch from fb5e47b to a4dd9e5 Compare October 27, 2025 08:43
Copy link
Member Author

@svg153 svg153 left a comment

Choose a reason for hiding this comment

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

.

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.

1 participant