feat: add romanToInteger solution #13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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."); | |
} |