Skip to content

Commit 6937400

Browse files
andygroveclaude
authored andcommitted
chore: Add take/untake workflow for issue self-assignment (apache#3270)
Adds a GitHub Actions workflow that allows contributors to self-assign issues by commenting "take" and unassign by commenting "untake". Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 525f25e commit 6937400

2 files changed

Lines changed: 57 additions & 0 deletions

File tree

.github/workflows/take.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
name: Assign/unassign the issue via `take` or `untake` comment
19+
on:
20+
issue_comment:
21+
types: created
22+
23+
permissions:
24+
issues: write
25+
26+
jobs:
27+
issue_assign:
28+
runs-on: ubuntu-latest
29+
if: (!github.event.issue.pull_request) && (github.event.comment.body == 'take' || github.event.comment.body == 'untake')
30+
concurrency:
31+
group: ${{ github.actor }}-issue-assign
32+
steps:
33+
- name: Take or untake issue
34+
env:
35+
COMMENT_BODY: ${{ github.event.comment.body }}
36+
ISSUE_NUMBER: ${{ github.event.issue.number }}
37+
USER_LOGIN: ${{ github.event.comment.user.login }}
38+
REPO: ${{ github.repository }}
39+
TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
run: |
41+
if [ "$COMMENT_BODY" == "take" ]
42+
then
43+
CODE=$(curl -H "Authorization: token $TOKEN" -LI https://api.github.com/repos/$REPO/issues/$ISSUE_NUMBER/assignees/$USER_LOGIN -o /dev/null -w '%{http_code}\n' -s)
44+
if [ "$CODE" -eq "204" ]
45+
then
46+
echo "Assigning issue $ISSUE_NUMBER to $USER_LOGIN"
47+
curl -X POST -H "Authorization: token $TOKEN" -H "Content-Type: application/json" -d "{\"assignees\": [\"$USER_LOGIN\"]}" https://api.github.com/repos/$REPO/issues/$ISSUE_NUMBER/assignees
48+
else
49+
echo "Cannot assign issue $ISSUE_NUMBER to $USER_LOGIN"
50+
fi
51+
elif [ "$COMMENT_BODY" == "untake" ]
52+
then
53+
echo "Unassigning issue $ISSUE_NUMBER from $USER_LOGIN"
54+
curl -X DELETE -H "Authorization: token $TOKEN" -H "Content-Type: application/json" -d "{\"assignees\": [\"$USER_LOGIN\"]}" https://api.github.com/repos/$REPO/issues/$ISSUE_NUMBER/assignees
55+
fi

docs/source/contributor-guide/contributing.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ Here are some areas where you can help:
3232

3333
We maintain a list of good first issues in GitHub [here](https://github.com/apache/datafusion-comet/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22). We also have a [roadmap](roadmap.md).
3434

35+
To assign yourself an issue, comment `take` on the issue. To unassign yourself, comment `untake`.
36+
3537
## Reporting issues
3638

3739
We use [GitHub issues](https://github.com/apache/datafusion-comet/issues) for bug reports and feature requests.

0 commit comments

Comments
 (0)