Skip to content

Commit

Permalink
comment the workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
HimanshuNarware committed Sep 4, 2024
1 parent 387e64e commit 1677a11
Show file tree
Hide file tree
Showing 7 changed files with 265 additions and 265 deletions.
34 changes: 17 additions & 17 deletions .github/workflows/auto-comment-on-pr-merge.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
name: Auto Comment on PR Merge
# name: Auto Comment on PR Merge

on:
pull_request:
types: [closed]
# on:
# pull_request:
# types: [closed]

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

steps:
- name: Add Comment to Merged PR
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
curl -H "Authorization: token $GITHUB_TOKEN" \
-X POST \
-d '{"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! 🚀"}' \
"https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments"
# steps:
# - name: Add Comment to Merged PR
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: |
# curl -H "Authorization: token $GITHUB_TOKEN" \
# -X POST \
# -d '{"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! 🚀"}' \
# "https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments"
86 changes: 43 additions & 43 deletions .github/workflows/check_duplicate_tools.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
name: Check for Duplicates and Close Issues on PR Merge
# name: Check for Duplicates and Close Issues on PR Merge

on:
pull_request:
types: [opened, synchronize, closed]
# on:
# pull_request:
# types: [opened, synchronize, closed]

jobs:
check-duplicates:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
# jobs:
# check-duplicates:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout repository
# uses: actions/checkout@v2

- name: Check for duplicate entries in product.json
run: |
# Check for duplicate entries based on the 'link' field in product.json
jq -r '.[].link' product.json | sort | uniq -d > duplicates.txt
if [ -s duplicates.txt ]; then
echo "Duplicate entries found in product.json based on 'link':"
cat duplicates.txt
exit 1
else
echo "No duplicate entries found based on 'link'."
fi
# - name: Check for duplicate entries in product.json
# run: |
# # Check for duplicate entries based on the 'link' field in product.json
# jq -r '.[].link' product.json | sort | uniq -d > duplicates.txt
# if [ -s duplicates.txt ]; then
# echo "Duplicate entries found in product.json based on 'link':"
# cat duplicates.txt
# exit 1
# else
# echo "No duplicate entries found based on 'link'."
# fi

close-issues:
runs-on: ubuntu-latest
needs: check-duplicates
if: github.event.pull_request.merged == true
# close-issues:
# runs-on: ubuntu-latest
# needs: check-duplicates
# if: github.event.pull_request.merged == true

steps:
- name: Checkout repository
uses: actions/checkout@v2
# steps:
# - name: Checkout repository
# uses: actions/checkout@v2

- name: Close linked issues
run: |
ISSUES=$(jq -r '.pull_request.body' "$GITHUB_EVENT_PATH" | grep -Eo '#[0-9]+' | tr -d '#')
for ISSUE in $ISSUES
do
echo "Closing issue #$ISSUE"
curl -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/issues/$ISSUE/comments \
-d '{"body":"Closed by PR #${{ github.event.pull_request.number }}"}'
curl -X PATCH -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/issues/$ISSUE \
-d '{"state":"closed"}'
done
# - name: Close linked issues
# run: |
# ISSUES=$(jq -r '.pull_request.body' "$GITHUB_EVENT_PATH" | grep -Eo '#[0-9]+' | tr -d '#')
# for ISSUE in $ISSUES
# do
# echo "Closing issue #$ISSUE"
# curl -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
# -H "Accept: application/vnd.github.v3+json" \
# https://api.github.com/repos/${{ github.repository }}/issues/$ISSUE/comments \
# -d '{"body":"Closed by PR #${{ github.event.pull_request.number }}"}'
# curl -X PATCH -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
# -H "Accept: application/vnd.github.v3+json" \
# https://api.github.com/repos/${{ github.repository }}/issues/$ISSUE \
# -d '{"state":"closed"}'
# done
60 changes: 30 additions & 30 deletions .github/workflows/close-old-pr-woc.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
name: Close Stale PRs
# name: Close Stale PRs

on:
schedule:
- cron: '0 0 * * *' # Runs daily at midnight
pull_request:
types:
- opened
- reopened
- synchronize
# on:
# schedule:
# - cron: '0 0 * * *' # Runs daily at midnight
# pull_request:
# types:
# - opened
# - reopened
# - synchronize

permissions:
pull-requests: write
issues: write
# permissions:
# pull-requests: write
# issues: write

jobs:
close_stale_prs:
runs-on: ubuntu-latest
permissions:
pull-requests: write
# jobs:
# close_stale_prs:
# runs-on: ubuntu-latest
# permissions:
# pull-requests: write

steps:
- uses: actions/stale@v7
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-pr-message: 'This PR has been automatically closed due to inactivity from the owner for 15 days.'
days-before-pr-stale: 15
days-before-pr-close: 0
exempt-pr-author: false
exempt-pr-labels: ''
only-labels: ''
operations-per-run: 30
remove-stale-when-updated: true
debug-only: false
# steps:
# - uses: actions/stale@v7
# with:
# repo-token: ${{ secrets.GITHUB_TOKEN }}
# stale-pr-message: 'This PR has been automatically closed due to inactivity from the owner for 15 days.'
# days-before-pr-stale: 15
# days-before-pr-close: 0
# exempt-pr-author: false
# exempt-pr-labels: ''
# only-labels: ''
# operations-per-run: 30
# remove-stale-when-updated: true
# debug-only: false
52 changes: 26 additions & 26 deletions .github/workflows/close-on-merge.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
name: Close Issues on PR Merge
# name: Close Issues on PR Merge

on:
pull_request:
types: [closed]
# on:
# pull_request:
# types: [closed]

jobs:
close-issues:
runs-on: ubuntu-latest
# # jobs:
# close-issues:
# runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2
# steps:
# - name: Checkout repository
# uses: actions/checkout@v2

- name: Close linked issues
if: github.event.pull_request.merged == true
run: |
ISSUES=$(jq -r '.pull_request.body' "$GITHUB_EVENT_PATH" | grep -Eo '#[0-9]+' | tr -d '#')
for ISSUE in $ISSUES
do
echo "Closing issue #$ISSUE"
curl -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/issues/$ISSUE/comments \
-d '{"body":"Closed by PR #${{ github.event.pull_request.number }}"}'
curl -X PATCH -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/issues/$ISSUE \
-d '{"state":"closed"}'
done
# - name: Close linked issues
# if: github.event.pull_request.merged == true
# run: |
# ISSUES=$(jq -r '.pull_request.body' "$GITHUB_EVENT_PATH" | grep -Eo '#[0-9]+' | tr -d '#')
# for ISSUE in $ISSUES
# do
# echo "Closing issue #$ISSUE"
# curl -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
# -H "Accept: application/vnd.github.v3+json" \
# https://api.github.com/repos/${{ github.repository }}/issues/$ISSUE/comments \
# -d '{"body":"Closed by PR #${{ github.event.pull_request.number }}"}'
# curl -X PATCH -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
# -H "Accept: application/vnd.github.v3+json" \
# https://api.github.com/repos/${{ github.repository }}/issues/$ISSUE \
# -d '{"state":"closed"}'
# done
28 changes: 14 additions & 14 deletions .github/workflows/greetings.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
name: Greetings
# name: Greetings

on: [pull_request_target, issues]
# on: [pull_request_target, issues]

jobs:
greeting:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/first-interaction@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: "Hi there! Thanks for opening this issue. We appreciate your contribution to this open-source project. We aim to respond or assign your issue as soon as possible."
pr-message: "Welcome to Our repository.🎊 Thank you so much for taking the time to point this out."
# jobs:
# greeting:
# runs-on: ubuntu-latest
# permissions:
# issues: write
# pull-requests: write
# steps:
# - uses: actions/first-interaction@v1
# with:
# repo-token: ${{ secrets.GITHUB_TOKEN }}
# issue-message: "Hi there! Thanks for opening this issue. We appreciate your contribution to this open-source project. We aim to respond or assign your issue as soon as possible."
# pr-message: "Welcome to Our repository.🎊 Thank you so much for taking the time to point this out."
44 changes: 22 additions & 22 deletions .github/workflows/greetings.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
name: 'Greetings'
# name: 'Greetings'

on:
fork:
push:
branches: [main]
issues:
types: [opened]
pull_request_target:
types: [opened]
# on:
# fork:
# push:
# branches: [main]
# issues:
# types: [opened]
# pull_request_target:
# types: [opened]

jobs:
welcome:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: EddieHubCommunity/gh-action-community/src/welcome@main
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: |
Congratulations, @${{ github.actor }}! 🎉 Thank you for creating your issue. Your contribution is greatly appreciated and we look forward to working with you to resolve the issue. Keep up the great work!
pr-message: |
Great job, @${{ github.actor }}! 🎉 Thank you for submitting your pull request. Your contribution is valuable and we appreciate your efforts to improve our project.
footer: 'We will promptly review your changes and offer feedback. Keep up the excellent work! Kindly remember to check our [contributing guidelines](https://github.com/HimanshuNarware/Devlabs/blob/main/CONTRIBUTING.md)'
# jobs:
# welcome:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v1
# - uses: EddieHubCommunity/gh-action-community/src/welcome@main
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# issue-message: |
# Congratulations, @${{ github.actor }}! 🎉 Thank you for creating your issue. Your contribution is greatly appreciated and we look forward to working with you to resolve the issue. Keep up the great work!
# pr-message: |
# Great job, @${{ github.actor }}! 🎉 Thank you for submitting your pull request. Your contribution is valuable and we appreciate your efforts to improve our project.
# footer: 'We will promptly review your changes and offer feedback. Keep up the excellent work! Kindly remember to check our [contributing guidelines](https://github.com/HimanshuNarware/Devlabs/blob/main/CONTRIBUTING.md)'
Loading

0 comments on commit 1677a11

Please sign in to comment.