Create test #32
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: Greetings | |
on: | |
issues: | |
types: [opened] | |
pull_request: | |
types: [opened] | |
push: | |
branches: | |
- main | |
jobs: | |
greeting: | |
runs-on: ubuntu-latest | |
permissions: | |
issues: write | |
pull-requests: write | |
contents: read | |
steps: | |
- name: Set up GitHub CLI | |
run: | | |
echo "Setting up GitHub CLI" | |
gh auth login --with-token <<< "${{ secrets.GITHUB_TOKEN }}" | |
- name: Issue Greeting | |
if: github.event_name == 'issues' && github.event.action == 'opened' | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
MESSAGE="Welcome to our project! 🎉 Thank you for opening your issue, @${{ github.actor }}! To help us assist you effectively, please include the following details: | |
- **Description**: Clearly describe the problem or feature you’re suggesting. | |
- **Steps to Reproduce**: If you're reporting a bug, list the steps to reproduce it. | |
- **Expected vs. Actual Behavior**: Explain what you expected to happen and what actually occurred. | |
- **Environment**: Include information about your environment (e.g., OS, version, browser). | |
- **Screenshots**: If applicable, attach screenshots or logs to illustrate the issue. | |
If you need further assistance, feel free to [Contact me](https://formsubmit.co/el/sumuhu). | |
Your feedback is invaluable in improving our project, and we appreciate your contribution!" | |
gh api \ | |
--method POST \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "X-GitHub-Api-Version: 2022-11-28" \ | |
/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/comments \ | |
-f body="$MESSAGE" | |
- name: Pull Request Greeting | |
if: github.event_name == 'pull_request' && github.event.action == 'opened' | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
MESSAGE="Amazing! You've submitted your first pull request, @${{ github.actor }}! 🎉 Thank you for your contribution. Here are a few things to keep in mind: | |
- **Description**: Ensure your pull request includes a clear description of what changes you made and why. | |
- **Related Issues**: Link any related issues to provide context. | |
- **Testing**: Describe any tests you’ve run to verify your changes and ensure nothing is broken. | |
- **Code Guidelines**: Please ensure your code adheres to our coding standards and formatting rules. | |
- **Review Process**: Once you submit, our team will review your changes. We may ask for adjustments, so keep an eye on any comments. | |
If you have any questions or need assistance, don’t hesitate to [Contact me](https://formsubmit.co/el/sumuhu). | |
Your efforts help us enhance the project, and we’re excited to work with you!" | |
gh api \ | |
--method POST \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "X-GitHub-Api-Version: 2022-11-28" \ | |
/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/comments \ | |
-f body="$MESSAGE" | |
- name: Push Notification | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
MESSAGE="A new push has been made to the main branch by @${{ github.actor }}. Thank you for your contribution! | |
Please remember to include detailed information in any issues or pull requests you create. This helps us address your concerns quickly and effectively. | |
If you would like to share additional information or if you have any questions, please reach out via this [Contact me](https://formsubmit.co/el/sumuhu) form." | |
# Create a new issue for push notifications | |
gh api \ | |
--method POST \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "X-GitHub-Api-Version: 2022-11-28" \ | |
/repos/${{ github.repository }}/issues \ | |
-f title="New Push Notification by @${{ github.actor }}" \ | |
-f body="$MESSAGE" |