🚀 [New Feature_LP] - The "show our apps screenshot" section is not user friendly at the time of iphone view #92
This file contains 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: Add Comment to Newly Open Issue | |
on: | |
issues: | |
types: [opened] | |
jobs: | |
add-comment: | |
runs-on: ubuntu-latest | |
permissions: | |
issues: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Check if author is not repository owner | |
run: | | |
if [[ ${{ github.event.issue.user.login }} == ${{ github.repository_owner }} ]]; then | |
echo "Author is repository owner. Skipping comment workflow." | |
exit 0 | |
fi | |
- name: Add Comment | |
uses: actions/github-script@v4 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
const { issue } = context.payload; | |
const author = issue.user.login; | |
const issueNumber = issue.number; | |
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! 😀`; | |
const { owner, repo } = context.repo; | |
await github.issues.createComment({ | |
owner: owner, | |
repo: repo, | |
issue_number: issueNumber, | |
body: comment | |
}); | |
console.log(`Comment added to the Issue #${issueNumber}.`); |