Skip to content

Commit b299c70

Browse files
authored
Fixes PR label and Comment Issue and also for Issue. (#105)
* Fixed Worflows of autocomment on prs * Rename Contributing.md * Rename Readme, Contributing and added Code_of_conduct.md * Fixed The workflows to run on different branch PR. * Revert "Fixed The workflows to run on different branch PR." This reverts commit 482bf40. * Fix PR label and Comment Issue and for Issues Also
1 parent b55f894 commit b299c70

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

.github/workflows/comment-on-issues.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ jobs:
1414
- name: Checkout repository
1515
uses: actions/checkout@v3
1616

17+
- name: Check if author is not repository owner
18+
run: |
19+
if [[ ${{ github.event.issue.user.login }} == ${{ github.repository_owner }} ]]; then
20+
echo "Author is repository owner. Skipping comment workflow."
21+
exit 0
22+
fi
23+
1724
- name: Add Comment
1825
uses: actions/github-script@v4
1926
with:
@@ -22,7 +29,7 @@ jobs:
2229
const { issue } = context.payload;
2330
const author = issue.user.login;
2431
const issueNumber = issue.number;
25-
const comment = `Hello @${author}! \n Thank you for raising this issue. \n\nPlease make sure to follow our [Contributing Guidelines. 💪🏻](https://github.com/CatsInTech/GitHub-ReadMe/blob/main/Contributing.md) \nDon't forget to ⭐ our [GitHub-ReadMe. 📃](https://github.com/CatsInTech/GitHub-ReadMe)\n\nOur review team will carefully assess the issue and reach out to you soon! 😇 \n We appreciate your patience! 😀`;
32+
const comment = `Hello @${author}! \n Thank you for raising this issue. \n\nPlease make sure to follow our [Contributing Guidelines. 💪🏻](https://github.com/CatsInTech/GitHub-ReadMe/blob/main/CONTRIBUTING.md) \nDon't forget to ⭐ our [GitHub-ReadMe. 📃](https://github.com/CatsInTech/GitHub-ReadMe)\n\nOur review team will carefully assess the issue and reach out to you soon! 😇 \n We appreciate your patience! 😀`;
2633
const { owner, repo } = context.repo;
2734
2835
await github.issues.createComment({
@@ -32,4 +39,4 @@ jobs:
3239
body: comment
3340
});
3441
35-
console.log(`Comment added to the Issue #${issueNumber}.`);
42+
console.log(`Comment added to the Issue #${issueNumber}.`);

.github/workflows/comment-on-prs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name: Add Comment to Newly Open PRs
33
on:
44
pull_request_target:
55
types: [opened]
6+
branches: [main, website, gh-pages]
67

78
jobs:
89
add-comment:

.github/workflows/label-prs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name: Add Labels to PRs
33
on:
44
pull_request_target:
55
types: [opened]
6+
branches: [main, website, gh-pages]
67

78
jobs:
89
add-labels:

0 commit comments

Comments
 (0)