Skip to content

Commit f25b511

Browse files
Merge branch 'CodeHarborHub:main' into main
2 parents 183b11f + 04e9951 commit f25b511

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Auto Content on Labels
2+
3+
on:
4+
issues:
5+
types: [opened]
6+
pull_request:
7+
types: [opened]
8+
9+
jobs:
10+
addContent:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Check for Labels
14+
id: check_labels
15+
run: echo "::set-output name=labels::${{ toJson(github.event.issue.labels) }}"
16+
17+
- name: Add Guidance Comment
18+
if: ${{ contains(steps.check_labels.outputs.labels, 'dsa-solution') }}
19+
uses: actions/github-script@v5
20+
with:
21+
github-token: ${{ secrets.GITHUB_TOKEN }}
22+
script: |
23+
const issueOrPR = github.context.payload.issue || github.context.payload.pull_request;
24+
const comment = `
25+
Hello there! 🌟 It looks like you've added the \`dsa-solution\` label.
26+
Please refer to our guidance on Data Structures & Algorithms solutions here: [DSA Solution Guidance](https://github.com/orgs/CodeHarborHub/discussions/3369#discussion-6940372).
27+
Thank you!
28+
`;
29+
github.issues.createComment({
30+
issue_number: issueOrPR.number,
31+
owner: github.context.repo.owner,
32+
repo: github.context.repo.repo,
33+
body: comment
34+
});

0 commit comments

Comments
 (0)