Skip to content

feat: add romanToInteger solution #13

feat: add romanToInteger solution

feat: add romanToInteger solution #13

Workflow file for this run

name: Sync Labels from Issue to PR
on:
pull_request:
types: [opened, reopened]
jobs:
sync-labels:
runs-on: ubuntu-latest
permissions:
contents: read
issues: write
pull-requests: write
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Sync Labels
uses: actions/github-script@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
if (context.payload.pull_request.body) {
const issueNumberMatch = context.payload.pull_request.body.match(/#(\d+)/);
if (issueNumberMatch && issueNumberMatch[1]) {
const issue_number = issueNumberMatch[1];
const issue = await github.issues.get({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue_number,
});
const labels = issue.data.labels.map(label => label.name);
await github.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels: labels
});
} else {
console.log("No issue number found in the pull request body.");
}
} else {
console.log("Pull request body is null or undefined.");
}