Skip to content

Convert nearby package to kotlin #14

Convert nearby package to kotlin

Convert nearby package to kotlin #14

name: Check Pull Request Scope
on:
pull_request:
types: [opened, synchronize]
permissions:
pull-requests: write
models: read
jobs:
check-scope:
runs-on: ubuntu-latest
steps:
# Use AI to detect if pull request mixes unrelated changes
- name: Analyse pull request changes
uses: actions/ai-inference@v1
id: analyze
with:
prompt: |
Analyse this pull request to determine if it contains unrelated changes.
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.
Examples of changes that are not acceptable:
* Fixing indentation or formatting in unrelated files or in unrelated parts of a file.
* Adding or removing unrelated comments.
Pull Request Title: ${{ github.event.pull_request.title }}
Pull Request Description: ${{ github.event.pull_request.body }}
Does this pull request appear to mix unrelated changes? Respond with only "yes" or "no".
model: openai/gpt-4o-mini
# If unrelated changes detected, remind contributor of guidelines
- name: Comment if unrelated changes detected
if: steps.analyze.outputs.response == 'yes'
uses: actions/github-script@v7
with:
script: |
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
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."
});