Skip to content

Open Source Friday Special - GADD - 05-15-2025 Pre-recorded #100

Open Source Friday Special - GADD - 05-15-2025 Pre-recorded

Open Source Friday Special - GADD - 05-15-2025 Pre-recorded #100

Workflow file for this run

name: Notify User
on:
issues:
types: [opened]
jobs:
notify-user:
runs-on: ubuntu-latest
steps:
- name: Check if stream date is not yet scheduled
id: check-date
env:
ISSUE_BODY: ${{ github.event.issue.body }}
run: |
echo "::set-output name=not_yet::$(echo '$ISSUE_BODY' | grep -q 'Not yet' && echo 'true' || echo 'false')"
- name: Comment on issue
if: steps.check-date.outputs.not_yet == 'true'
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\nThank you for your interest in Open Source Friday! Please remember to book a date and time for the stream at the following link: https://calendar.app.google/7fdFRJ7G1jeAM5Vy8 \n\nTalk soon,\nKedasha and Andrea`
};
github.rest.issues.createComment(issueComment);
}