Batch 26 introduction to data types #5
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: Notify Admins on New PR | |
on: | |
pull_request: | |
types: [opened, reopened, review_requested, review] | |
jobs: | |
notify_admin: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Send notification to admins | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
const adminUsername = 'nurudeenadeyemi'; // Replace with actual admin GitHub username | |
const prTitle = context.payload.pull_request.title; | |
const prUrl = context.payload.pull_request.html_url; | |
await github.rest.issues.createComment({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
issue_number: context.payload.pull_request.number, | |
body: `@${adminUsername} A new pull request titled "${prTitle}" has been opened: ${prUrl}` | |
}); |