From 11b2e2a52d4d5308c0c9734825a7de07f58fc1a0 Mon Sep 17 00:00:00 2001 From: Ayush kumar <67006255+Ayush7614@users.noreply.github.com> Date: Sat, 16 Oct 2021 20:42:30 +0530 Subject: [PATCH] Added Github Actions Greetings and Stale --- .github/workflows/greetings.yml | 29 +++++++++++++++++++++++ .github/workflows/stale.yml | 41 +++++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 .github/workflows/greetings.yml create mode 100644 .github/workflows/stale.yml diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml new file mode 100644 index 0000000..6c3d39b --- /dev/null +++ b/.github/workflows/greetings.yml @@ -0,0 +1,29 @@ +name: Greetings + +on: + issues: + types: [opened] + pull_request_target: + types: [closed] + pull_request: + types: [opened] + +jobs: + greeting: + runs-on: ubuntu-latest + steps: + - name: Greet New Contributors for Creating New PR/Issues. + uses: actions/first-interaction@v1 + if: github.event.action =='opened' && (github.event_name == 'pull_request' || github.event_name == 'issues') + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + issue-message: "@${{ github.actor }} Welcome to forestTreesTagging 🥳 Thanks for opening this Issue 🙌, This Will definitely Improve our Project💖.While we are having a look at this. If you want to work on this then,feel free to self-assign and start working on it.📄 **Use `/assign` to self-assign this issue**." + pr-message: "@${{ github.actor }} Thank you for Opening pull request🥳. We will get back to you as soon as possible. Your patience is greatly appreciated! Thanks! 🥳. PS: Please double check that you linked the corresponding issue." + + - name: Congratulate on every PR merge + if: github.event_name == 'pull_request_target' && github.event.action == 'closed' && github.event.pull_request.merged == true + uses: peter-evans/create-or-update-comment@v1 + with: + issue-number: ${{tojson(github.event.number)}} + body: | + @${{ github.event.pull_request.user.login }} Hurray, your PR got merged 🥳. Thanks a bunch. Feel free to take another Issue.💖 diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 0000000..198909e --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,41 @@ +name: Mark Stale issues +name: Mark stale pull requests + + +on: + schedule: + - cron: "30 1 * * *" + +jobs: + stale: + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + stale-issue-message: 'The issue labelled as stale because it has been open for more than 7 days with inactivity.' + days-before-stale: 7 + days-before-close: -1 + stale-issue-label: 'Stale' + exempt-issue-labels: 'Announcement,Pinned' + remove-stale-when-updated: true + + + runs-on: ubuntu-latest + + steps: + - uses: actions/stale@v3.0.11 + with: + # Token for the repository. Can be passed in using `{{ secrets.GITHUB_TOKEN }}`. + repo-token: ${{ secrets.GITHUB_TOKEN }} + stale-pr-message: 'Due to inactivity this pull request has been marked as stale.' + # The message to post on the issue when closing it. If none provided, will not comment when closing an issue. + close-pr-message: 'Closing this pr due to no activity.' + # The number of days old an issue can be before marking it stale. Set to -1 to never mark issues or pull requests as stale automatically. + days-before-stale: 7 + # The number of days to wait to close an issue or pull request after it being marked stale. Set to -1 to never close stale issues. + days-before-close: 7 + # The label to apply when a pull request is stale. + stale-pr-label: 'Stale' + # The label to apply when a pull request is closed. + close-pr-label: 'Stale-n-closed' \ No newline at end of file