-
Notifications
You must be signed in to change notification settings - Fork 0
27 lines (25 loc) · 1.28 KB
/
send-guest-guidelines.yml
File metadata and controls
27 lines (25 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
name: Send Instructions to Guest
on:
issues:
types: [labeled]
jobs:
send-instructions:
runs-on: ubuntu-latest
if: github.event.label.name == 'scheduled'
steps:
- name: Comment on issue
uses: actions/github-script@v5
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const issueBody = context.payload.issue.body;
const githubHandleMatch = issueBody.match(/@[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38}/gi);
if (githubHandleMatch && githubHandleMatch.length > 0) {
const githubHandle = githubHandleMatch[0].substring(1); // Remove the '@' from the handle
const issueComment = {
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: `Hey @${githubHandle}✨,\n\nYou're officially scheduled for **Open Source Friday**! 🚀🎥. Here are some guidelines on preparing for the live stream:\n\n [Preparation Instructions](https://gist.github.com/LadyKerr/9b7d6dccde55b3f30398612d1290b7dc)\n\nLet us know if you have any questions!,\nKedasha & Andrea 👯`
};
github.rest.issues.createComment(issueComment); }