Skip to content

🔥 - Test Issue

🔥 - Test Issue #2

Workflow file for this run

name: Ensure Issue Id Title Format
on:
issues:
types: [opened, edited]
jobs:
check-and-update-title:
runs-on: ubuntu-latest
steps:
- name: Check Issue Title Format
uses: actions/github-script@v6
with:
script: |
const issueNumber = context.payload.issue.number; // Usar context.payload.issue.number directamente
const issueTitle = context.payload.issue.title;
const formattedTitle = `${issueNumber} - ${issueTitle.replace(/^\d+\s*-\s*/, '')}`;
if (issueTitle !== formattedTitle) {
await github.rest.issues.update({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issueNumber, // Cambia 'number' a 'issue_number'
title: formattedTitle
});
}