-
-
Notifications
You must be signed in to change notification settings - Fork 160
34 lines (31 loc) · 1.19 KB
/
auto-content-on-labels.yml
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
28
29
30
31
32
33
34
name: Auto Content on Labels
on:
issues:
types: [opened]
pull_request:
types: [opened]
jobs:
addContent:
runs-on: ubuntu-latest
steps:
- name: Check for Labels
id: check_labels
run: echo "::set-output name=labels::${{ toJson(github.event.issue.labels) }}"
- name: Add Guidance Comment
if: ${{ contains(steps.check_labels.outputs.labels, 'dsa-solution') }}
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const issueOrPR = github.context.payload.issue || github.context.payload.pull_request;
const comment = `
Hello there! 🌟 It looks like you've added the \`dsa-solution\` label.
Please refer to our guidance on Data Structures & Algorithms solutions here: [DSA Solution Guidance](https://github.com/orgs/CodeHarborHub/discussions/3369#discussion-6940372).
Thank you!
`;
github.issues.createComment({
issue_number: issueOrPR.number,
owner: github.context.repo.owner,
repo: github.context.repo.repo,
body: comment
});