Open Source Friday Special - GADD - 05-15-2025 Pre-recorded #100
This file contains hidden or 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 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); | |
| } |