-
Notifications
You must be signed in to change notification settings - Fork 18
Add issue duplicate checker workflow #987
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
enyst
wants to merge
5
commits into
main
Choose a base branch
from
add-issue-duplicate-checker-workflow
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
8eca5bc
Add issue duplicate checker workflow
enyst 7e4d5c8
Merge remote-tracking branch 'origin/main' into add-issue-duplicate-c…
openhands-agent c6ffa91
chore: pin duplicate checker action
openhands-agent 6f6a94f
fix: tighten duplicate checker workflow dispatch
openhands-agent 93f9335
chore: polish duplicate checker workflows
openhands-agent File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| --- | ||
| name: Issue Duplicate Check via OpenHands Cloud | ||
|
|
||
| on: | ||
| issues: | ||
| types: [opened] | ||
| schedule: | ||
| - cron: 0 9 * * * | ||
| workflow_dispatch: | ||
| inputs: | ||
| mode: | ||
| description: Which workflow path to run | ||
| required: true | ||
| type: choice | ||
| options: | ||
| - smoke-clone | ||
| - issue-check | ||
| - auto-close | ||
| default: smoke-clone | ||
| issue_number: | ||
| description: Existing issue number to analyze when mode is issue-check | ||
| required: false | ||
| type: number | ||
| close_after_days: | ||
| description: Days to wait before auto-closing duplicate candidates in auto-close mode | ||
| required: false | ||
| type: number | ||
| default: 3 | ||
|
|
||
| permissions: | ||
| contents: read | ||
| issues: write | ||
|
|
||
| jobs: | ||
| smoke-clone: | ||
| if: github.event_name == 'workflow_dispatch' && inputs.mode == 'smoke-clone' | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 5 | ||
| steps: | ||
| - name: Clone repository | ||
| env: | ||
| REPOSITORY: ${{ github.repository }} | ||
| run: | | ||
| git clone --depth 1 "https://github.com/${REPOSITORY}.git" /tmp/repo-clone | ||
| echo "REPO_HEAD=$(git -C /tmp/repo-clone rev-parse --short HEAD)" >> "$GITHUB_ENV" | ||
|
|
||
| - name: Summarize smoke test | ||
| run: | | ||
| { | ||
| echo "## Smoke clone completed" | ||
| echo | ||
| echo "- Repository cloned to /tmp/repo-clone" | ||
| echo "- Repository HEAD: ${REPO_HEAD}" | ||
| } >> "$GITHUB_STEP_SUMMARY" | ||
|
|
||
| issue-duplicate-check: | ||
| if: | | ||
| github.event_name == 'issues' || | ||
| (github.event_name == 'workflow_dispatch' && inputs.mode == 'issue-check' && inputs.issue_number != '') | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 35 | ||
| concurrency: | ||
| group: issue-duplicate-check-${{ github.repository }}-${{ github.event.issue.number || inputs.issue_number }} | ||
| cancel-in-progress: false | ||
| steps: | ||
| - name: Run issue duplicate check | ||
| uses: OpenHands/extensions/plugins/issue-duplicate-checker@fb020c71eb8e7cd2678f0251ab24327d3738da7d | ||
| with: | ||
| mode: issue-check | ||
| repository: ${{ github.repository }} | ||
| issue-number: ${{ github.event.issue.number || inputs.issue_number }} | ||
| close-after-days: ${{ inputs.close_after_days || '3' }} | ||
| openhands-api-key: ${{ secrets.OPENHANDS_API_KEY }} | ||
| github-token: ${{ secrets.OPENHANDS_BOT_GITHUB_PAT_PUBLIC || github.token }} | ||
|
|
||
| auto-close-duplicates: | ||
| if: | | ||
| github.event_name == 'schedule' || | ||
| (github.event_name == 'workflow_dispatch' && inputs.mode == 'auto-close') | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 20 | ||
| concurrency: | ||
| group: auto-close-duplicates-${{ github.repository }} | ||
| cancel-in-progress: false | ||
| steps: | ||
| - name: Auto-close aged duplicate candidates | ||
| uses: OpenHands/extensions/plugins/issue-duplicate-checker@fb020c71eb8e7cd2678f0251ab24327d3738da7d | ||
| with: | ||
| mode: auto-close | ||
| repository: ${{ github.repository }} | ||
| close-after-days: ${{ inputs.close_after_days || '3' }} | ||
| github-token: ${{ secrets.OPENHANDS_BOT_GITHUB_PAT_PUBLIC || github.token }} | ||
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| --- | ||
| name: Remove duplicate candidate label on activity | ||
|
|
||
| on: | ||
| issue_comment: | ||
| types: [created] | ||
|
|
||
| permissions: | ||
| issues: write | ||
|
|
||
| concurrency: | ||
| group: remove-duplicate-${{ github.repository }}-${{ github.event.issue.number }} | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| remove-duplicate-candidate: | ||
| if: | | ||
| github.event.issue.state == 'open' && | ||
| github.event.issue.pull_request == null && | ||
| contains(github.event.issue.labels.*.name, 'duplicate-candidate') && | ||
| github.event.comment.user.type != 'Bot' && | ||
| !startsWith(github.event.comment.body || '', '<!-- openhands-duplicate-check') && | ||
| !startsWith(github.event.comment.body || '', '<!-- openhands-duplicate-veto') | ||
| runs-on: ubuntu-latest | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No runs-on: ubuntu-latest
timeout-minutes: 10 |
||
| timeout-minutes: 10 | ||
| steps: | ||
| - name: Remove duplicate-candidate label | ||
| uses: OpenHands/extensions/plugins/issue-duplicate-checker@fb020c71eb8e7cd2678f0251ab24327d3738da7d | ||
| with: | ||
| mode: remove-label | ||
| github-token: ${{ secrets.OPENHANDS_BOT_GITHUB_PAT_PUBLIC || github.token }} | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No
timeout-minutesis set forsmoke-clone. Agit clone --depth 1should complete in seconds; addingtimeout-minutes: 5here would surface any unexpected hang quickly instead of waiting for GitHub’s 6-hour default.