Skip to content

Commit

Permalink
Added worflows folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Anjaliavv51 committed Oct 1, 2024
1 parent 9b623da commit 16f5800
Show file tree
Hide file tree
Showing 14 changed files with 636 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Bug report 🐞
description: File a bug report
title: "🐞[bug]: "
body:
- type: checkboxes
id: existing-issue
attributes:
label: Is there an existing issue for this?
description: Please search to see if an issue already exists for the bug you encountered.
options:
- label: I have searched the existing issues
required: true
- type: textarea
id: what-happened
attributes:
label: Describe the bug
description: A concise description of what you are experiencing.
placeholder: Tell us what you see!
validations:
required: true
- type: textarea
id: expected-behaviour
attributes:
label: Expected behavior
description: A clear and concise description of what you expected to happen.
validations:
required: true
- type: textarea
id: screenshots
attributes:
label: Add ScreenShots
description: Add sufficient ScreenShots to explain your issue.
- type: dropdown
id: browsers
attributes:
label: What browsers are you seeing the problem on?
multiple: true
options:
- Firefox
- Chrome
- Safari
- Microsoft Edge
- type: checkboxes
id: terms
attributes:
label: Record
options:
- label: "I have read the Contributing Guidelines"
required: true
- label: "I'm a GSSOC'24EXTD contributor"
required: true
- label: "I have starred the repository"
required: true
59 changes: 59 additions & 0 deletions .github/ISSUE_TEMPLATE/documentation_update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: 📝 Documentation Update
description: Improve Documentation
title: "📝[documentation Update]: "
body:
- type: checkboxes
id: existing-issue
attributes:
label: Is there an existing issue for this?
description: Please search to see if an issue already exists for the updates you want to make.
options:
- label: I have searched the existing issues
required: true
- type: textarea
id: issue-description
attributes:
label: Issue Description
description: Please provide a clear description of the documentation update you are suggesting.
placeholder: Describe the improvement or correction you'd like to see in the documentation.
validations:
required: true
- type: textarea
id: suggested-change
attributes:
label: Suggested Change
description: Provide details of the proposed change to the documentation.
placeholder: Explain how the documentation should be updated or corrected.
validations:
required: true
- type: textarea
id: rationale
attributes:
label: Rationale
description: Why is this documentation update necessary or beneficial?
placeholder: Explain the importance or reasoning behind the suggested change.
validations:
required: False
- type: dropdown
id: urgency
attributes:
label: Urgency
description: How urgently do you believe this documentation update is needed?
options:
- High
- Medium
- Low
default: 0
validations:
required: true
- type: checkboxes
id: terms
attributes:
label: Record
options:
- label: "I have read the Contributing Guidelines"
required: true
- label: "I'm a GSSOC'24EXTD contributor"
required: true
- label: "I have starred the repository"
required: true
62 changes: 62 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: ✨ Feature Request
description: Suggest a feature
title: "✨[feature Request]: "
body:
- type: checkboxes
id: existing-issue
attributes:
label: Is there an existing issue for this?
description: Please search to see if an issue already exists for this feature.
options:
- label: I have searched the existing issues
required: true
- type: textarea
id: feature-description
attributes:
label: Feature Description
description: Please provide a detailed description of the feature you are requesting.
placeholder: Describe the new feature or enhancement you'd like to see.
validations:
required: true
- type: textarea
id: use-case
attributes:
label: Use Case
description: How would this feature enhance your use of the project?
placeholder: Describe a specific use case or scenario where this feature would be beneficial.
validations:
required: true
- type: textarea
id: benefits
attributes:
label: Benefits
description: What benefits would this feature bring to the project or community?
placeholder: Explain the advantages of implementing this feature.
- type: textarea
id: screenShots
attributes:
label: Add ScreenShots
description: If any...
- type: dropdown
id: priority
attributes:
label: Priority
description: How important is this feature to you?
options:
- High
- Medium
- Low
default: 0
validations:
required: true
- type: checkboxes
id: terms
attributes:
label: Record
options:
- label: "I have read the Contributing Guidelines"
required: true
- label: "I'm a GSSOC'24EXTD contributor"
required: true
- label: "I have starred the repository"
required: true
30 changes: 30 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!-- ISSUE & PR TITLE SHOULD BE SAME-->
## Description
<!--Please include a brief description of the changes-->


## Related Issues

<!--Cite any related issue(s) this pull request addresses. If none, simply state “None”-->
- Closes #

## Type of PR
<!-- Mention PR Type according to the issue in brackets below and check the below box -->
- [ ] ()

## Screenshots / videos (if applicable)
<!--Attach any relevant screenshots or videos demonstrating the changes-->


## Checklist
<!-- [X] - put a cross/X inside [] to check the box -->
- [ ] I have gone through the [contributing guide](https://github.com/Anjaliavv51/Retro)
- [ ] I have updated my branch and synced it with project `main` branch before making this PR
- [ ] I have performed a self-review of my code
- [ ] I have tested the changes thoroughly before submitting this pull request.
- [ ] I have provided relevant issue numbers, screenshots, and videos after making the changes.
- [ ] I have commented my code, particularly in hard-to-understand areas.


## Additional context:
<!--Include any additional information or context that might be helpful for reviewers.-->
45 changes: 45 additions & 0 deletions .github/workflows/add-gssoc-label-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Auto Label PR

on:
pull_request:
types: [opened, reopened, synchronize]

jobs:
label_pr:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Label PR
uses: actions/github-script@v6
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const pr = context.payload.pull_request;
const prBody = pr.body ? pr.body.toLowerCase() : '';
const prTitle = pr.title.toLowerCase();
const addLabel = async (label) => {
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: pr.number,
labels: [label]
});
};
if (prBody.includes('documentation') || prTitle.includes('doc') || prBody.includes('readme')) {
await addLabel('documentation');
}
if (prBody.includes('feature') || prBody.includes('enhancement') || prTitle.includes('add') || prTitle.includes('implement')) {
await addLabel('enhancement');
}
if (prBody.includes('bug') || prBody.includes('fix') || prTitle.includes('fix') || prTitle.includes('resolve')) {
await addLabel('bug');
}
if (prBody.includes('GSSOCEXTD')) {
await addLabel('gssoc');
}
57 changes: 57 additions & 0 deletions .github/workflows/assign.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Assign Issue to Creator

on:
issue_comment:
types: [created]

jobs:
assign-issue:
runs-on: ubuntu-latest
if: contains(github.event.comment.body, '/assign')
steps:
- name: Check commenter permissions
id: check-permissions
uses: actions/github-script@v6
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const { owner, repo } = context.repo;
const commenter = context.payload.comment.user.login;
const { data: repoPermission } = await github.rest.repos.getCollaboratorPermissionLevel({
owner,
repo,
username: commenter,
});
const allowedPermissions = ['admin', 'maintain', 'write'];
const hasPermission = allowedPermissions.includes(repoPermission.permission);
console.log(`Commenter ${commenter} has permission: ${hasPermission}`);
return hasPermission;
- name: Assign issue to creator
if: steps.check-permissions.outputs.result == 'true'
uses: actions/github-script@v6
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const { owner, repo } = context.repo;
const issue_number = context.issue.number;
const { data: issue } = await github.rest.issues.get({
owner,
repo,
issue_number,
});
const creator = issue.user.login;
await github.rest.issues.addAssignees({
owner,
repo,
issue_number,
assignees: [creator],
});
console.log(`Assigned issue #${issue_number} to creator ${creator}`);
37 changes: 37 additions & 0 deletions .github/workflows/auto-comment-on-pr-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Auto Comment on PR Merge

on:
pull_request_target:
types: [closed]

permissions:
issues: write
pull-requests: write

jobs:
comment:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest

steps:
- name: Add Comment to Merged PR
run: |
COMMENT=$(cat <<EOF
{
"body": "🎉 Your pull request has been successfully merged! 🎉 Thank you for your contribution to our project. Your efforts are greatly appreciated. Keep up the fantastic work! 🚀"
}
EOF
)
RESPONSE=$(curl -s -o response.json -w "%{http_code}" \
-X POST \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments \
-d "$COMMENT")
cat response.json
if [ "$RESPONSE" -ne 201 ]; then
echo "Failed to add comment"
exit 1
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading

0 comments on commit 16f5800

Please sign in to comment.