You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Does this comment ask to be assigned to the issue?
19
+
Respond with only "yes" or "no".
20
+
21
+
Comment: ${{ github.event.comment.body }}
22
+
model: openai/gpt-4o-mini
23
+
24
+
- name: Handle assignment
25
+
if: steps.check-request.outputs.response == 'yes'
26
+
uses: actions/github-script@v7
27
+
with:
28
+
script: |
29
+
// Check if the issue is already assigned
30
+
const issue = await github.rest.issues.get({
31
+
owner: context.repo.owner,
32
+
repo: context.repo.repo,
33
+
issue_number: context.issue.number
34
+
});
35
+
36
+
if (issue.data.assignees.length > 0) {
37
+
// Issue is already assigned to someone else
38
+
await github.rest.issues.createComment({
39
+
owner: context.repo.owner,
40
+
repo: context.repo.repo,
41
+
issue_number: context.issue.number,
42
+
body: "This issue has already been assigned. Please find another issue to work on: https://github.com/commons-app/apps-android-commons/issues?q=is%3Aissue%20state%3Aopen%20type%3ABug%20no%3Aassignee%20-label%3A%22low%20priority%22%20-label%3Adebated%20-label%3Aupstream"
# Use AI to detect if pull request mixes unrelated changes
16
+
- name: Analyse pull request changes
17
+
uses: actions/ai-inference@v1
18
+
id: analyze
19
+
with:
20
+
prompt: |
21
+
Analyse this pull request to determine if it contains unrelated changes.
22
+
A pull request should modify only the code that really needs to be modified to solve the issue at hand. Changes unrelated to the issue at hand can be made in other pull requests.
23
+
24
+
Examples of changes that are not acceptable:
25
+
* Fixing indentation or formatting in unrelated files or in unrelated parts of a file.
Does this pull request appear to mix unrelated changes? Respond with only "yes" or "no".
32
+
model: openai/gpt-4o-mini
33
+
34
+
# If unrelated changes detected, remind contributor of guidelines
35
+
- name: Comment if unrelated changes detected
36
+
if: steps.analyze.outputs.response == 'yes'
37
+
uses: actions/github-script@v7
38
+
with:
39
+
script: |
40
+
await github.rest.issues.createComment({
41
+
owner: context.repo.owner,
42
+
repo: context.repo.repo,
43
+
issue_number: context.issue.number,
44
+
body: "This pull request appears to contain unrelated changes. A pull request should modify only the code that really needs to be modified to solve the issue at hand. Please review [CONTRIBUTING.md](https://github.com/commons-app/apps-android-commons/blob/master/CONTRIBUTING.md) and consider splitting this into separate pull requests."
0 commit comments