Skip to content

Commit

Permalink
release: handle-stale-discussions v1 (#6)
Browse files Browse the repository at this point in the history
* chore: build action

* chore: build action

* chore: build action

* chore: build action

* chore: build action

* chore: build action

* fix: package action, refactor, some fixes

* fix: package action, refactor, some fixes

* fix: package action, refactor, some fixes

* fix: package action, refactor, some fixes

* fix: package action, refactor, some fixes

* refactor client

* undo refactor client

* refactor client

* refactor client

* refactor client

* refactor client

* refactor client

* refactor client

* refactor client

* refactor client

* fix: implement logic discussed in meetings, refactor logic

* add debug statements

* add debug statements

* add debug statements

* add debug statements

* refactor further

* remove days-until-close and add dependabot

* chore: more refactor, adjust error messages

* chore: adjust logging messages

* chore: adjust logging messages

* chore: adjust logging messages

* chore: adjust logging messages

* chore: adjust logging messages

* fix: foreach bug?

* chore: adjust logging messages

* fix(temp): only checks most recent 1 comment per discussion

* log

* log

* incorporated sggested changes in workflow

* githubClient updated

* build branch

* updations as suggested

* changes implemented for cache object

* added code for writing back the objects to cache

* wrote back label id to cache object

* cache updated with defaultOptions

* updated cache object

* added typePolicies

* removed default options

* updated workflow logic

* added closed field in discussionData query

* added return to closed statement

* checking closed flag

* print flag

* logging

* logging

* logging

* lockDiscussion mutation added

* cache issue and logging

* logging in cache

* cache error

* cache error fix

* cache error fix

* logging for instructions reply

* logging

* logging commentId

* logging for instrcutions reply

* logging again

* minor edits

* minor edits before final testing

* minor comment text change

* compiled files

* error handling, final touches, new props

* add new proposed keyword prop and defalt to readme and action.yml

* adjust checking instructions reply logic

* adjust checking instructions reply logic

* adjust instructions reply

* update readme and our own workflow file to use stale discussions

* fix: boolean inputs always true

* chore: remove async when no need to await for response

* feat: add prop to decide how to handle stale discussions

* feat: support patial day values

* chore: adjust logging when stale

* chore: run workflow every 30 minutes

* chore: log eventName

* chore: log payload

* feat: add instructions reply immediately if triggered by created discussion comment

* chore: reorganize logic for new comment trigger

* chore: update readme and workflow file with new event trigger functionality

* chore: update contributing guide

---------

Co-authored-by: shailja <[email protected]>
  • Loading branch information
peterwoodworth and khushail authored Jun 24, 2023
1 parent 3fd2115 commit 068d2ff
Show file tree
Hide file tree
Showing 36 changed files with 92,775 additions and 744 deletions.
9 changes: 9 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: 2
updates:
- package-ecosystem: npm
directory: "/"
schedule:
interval: weekly
day: tuesday
open-pull-requests-limit: 10
target-branch: 'main'
4 changes: 2 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@

---

* [ ] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws-actions/configure-aws-credentials/blob/main/CONTRIBUTING.md)
* [ ] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws-github-ops/handle-stale-discussions/blob/main/CONTRIBUTING.md)

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
36 changes: 8 additions & 28 deletions .github/workflows/handle-stale-discussions.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,17 @@
name: HandleStaleDiscussions
on:
schedule:
- cron: '*/30 * * * *'
push:
branches:
- main
pull_request:
branches:
- main
- cron: '0 */4 * * *'
discussion_comment:
types: [created]

jobs:
run-action:
name: Run action
handle-stale-discussions:
name: Handle stale discussions
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Use Node.js 16.x
uses: actions/setup-node@v2
with:
node-version: 16.x
cache: 'npm'
cache-dependency-path: package-lock.json

- name: Install dependencies
run: npm ci

- name: Build
run: npm run build

- name: Handle stale discussions
uses: ./
- name: Stale discussions action
uses: aws-github-ops/handle-stale-discussions@main
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
DEFAULT_BRANCH: master

11 changes: 5 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,17 @@ Contributions via pull requests are much appreciated. Before sending us a pull r
To send us a pull request, please:

1. Fork the repository.
2. Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change.
3. Ensure local tests pass.
4. Commit to your fork using clear commit messages.
5. Send us a pull request, answering any default questions in the pull request interface.
6. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.
2. Modify the source; Install packages with `npm i`, and build your code with `npm run package`.
3. Commit to your fork using clear commit messages.
4. Send us a pull request, answering any default questions in the pull request interface.
5. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.

GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and
[creating a pull request](https://help.github.com/articles/creating-a-pull-request/).


## Finding contributions to work on
Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels (enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any 'help wanted' issues is a great place to start.
Looking at the existing issues is a great way to find something to contribute on.


## Code of Conduct
Expand Down
Loading

0 comments on commit 068d2ff

Please sign in to comment.