Open Source Friday Special - GADD - 05-15-2025 Pre-recorded #484
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: 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); } |