Skip to content

Commit dd9e36c

Browse files
authored
Migrate most GitHub HashiBot behaviors to GitHub Actions (#1288)
GitHub HashiBot is being deprecated and this replaces behaviors with equivalent workflows in GitHub Actions. The `pull_request_size_labeler` behavior will be handled one an upstream enhancement is merged (or if we decide to use a fork with the change).
1 parent aa3e658 commit dd9e36c

File tree

7 files changed

+73
-30
lines changed

7 files changed

+73
-30
lines changed

.github/labeler-issue-triage.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
bug:
2+
- 'panic:'
3+
crash:
4+
- 'panic:'
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
dependencies:
2+
- vendor/**/*
3+
documentation:
4+
- website/**/*
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Issue Comment Created Triage
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
7+
jobs:
8+
issue_comment_triage:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions-ecosystem/action-remove-labels@v1
12+
with:
13+
labels: |
14+
stale
15+
waiting-reply

.github/workflows/issue-opened.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Issue Opened Triage
2+
3+
on:
4+
issues:
5+
types: [opened]
6+
7+
jobs:
8+
issue_triage:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: github/issue-labeler@v2
13+
with:
14+
repo-token: "${{ secrets.GITHUB_TOKEN }}"
15+
configuration-path: .github/labeler-issue-triage.yml

.github/workflows/lock.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: 'Lock Threads'
2+
3+
on:
4+
schedule:
5+
- cron: '49 1 * * *'
6+
7+
jobs:
8+
lock:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: dessant/lock-threads@v2
12+
with:
13+
github-token: ${{ github.token }}
14+
issue-lock-comment: >
15+
I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.
16+
17+
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
18+
issue-lock-inactive-days: '30'
19+
pr-lock-comment: >
20+
I'm going to lock this pull request because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.
21+
22+
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
23+
pr-lock-inactive-days: '30'

.github/workflows/pull-request.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: "Pull Request Triage"
2+
3+
on: [pull_request_target]
4+
5+
jobs:
6+
triage:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/labeler@v3
10+
with:
11+
configuration-path: .github/labeler-pull-request-triage.yml
12+
repo-token: "${{ secrets.GITHUB_TOKEN }}"

.hashibot.hcl

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,3 @@
1-
poll "closed_issue_locker" "locker" {
2-
schedule = "0 10 5 * * *"
3-
closed_for = "720h" # 30 days
4-
no_comment_if_no_activity_for = "1440h" # 60 days
5-
max_issues = 500
6-
sleep_between_issues = "5s"
7-
message = <<-EOF
8-
I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.
9-
10-
If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!
11-
EOF
12-
}
13-
14-
behavior "regexp_issue_labeler" "panic_label" {
15-
regexp = "panic:"
16-
labels = ["crash", "bug"]
17-
}
18-
19-
behavior "remove_labels_on_reply" "remove_stale" {
20-
labels = ["waiting-response", "stale"]
21-
only_non_maintainers = true
22-
}
23-
241
behavior "pull_request_size_labeler" "size" {
252
label_prefix = "size/"
263
label_map = {
@@ -50,10 +27,3 @@ behavior "pull_request_size_labeler" "size" {
5027
}
5128
}
5229
}
53-
54-
behavior "pull_request_path_labeler" "cross_provider_labels" {
55-
label_map = {
56-
"documentation" = ["website/**/*"]
57-
"dependencies" = ["vendor/**/*"]
58-
}
59-
}

0 commit comments

Comments
 (0)