Skip to content

chore: trigger issue-labels-sync workflow #2

chore: trigger issue-labels-sync workflow

chore: trigger issue-labels-sync workflow #2

name: Migrate Legacy Labels
on:
schedule:
- cron: '0 7 * * *' # Daily at 07:00 UTC (runs before label sync at 08:00)
workflow_dispatch:
permissions:
issues: write
jobs:
migrate:
runs-on: ubuntu-latest
steps:
- name: Rename legacy labels to type: equivalents

Check failure on line 15 in .github/workflows/issue-labels-migrate.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/issue-labels-migrate.yml

Invalid workflow file

You have an error in your yaml syntax on line 15
uses: actions/github-script@v7
with:
script: |
// Legacy label → canonical type: label.
// Rename preserves all issue associations automatically.
const MIGRATIONS = [
{ from: 'bug', to: 'type:bug' },
{ from: 'question', to: 'type:question' },
{ from: 'enhancement', to: 'type:enhancement' },
{ from: 'documentation', to: 'type:documentation' }
];
for (const { from, to } of MIGRATIONS) {
try {
await github.rest.issues.getLabel({
owner: context.repo.owner,
repo: context.repo.repo,
name: from
});
// Old label exists — rename it
await github.rest.issues.updateLabel({
owner: context.repo.owner,
repo: context.repo.repo,
name: from,
new_name: to
});
core.info(`Migrated label: ${from} → ${to}`);
} catch (err) {
if (err.status === 404) {
core.info(`Legacy label "${from}" not found — no migration needed`);
} else {
core.warning(`Failed to migrate ${from}: ${err.message}`);
}
}
}
core.info('Label migration complete');