name: Dependency Submission

on:
  push:
    branches: [ 'main' ]
  workflow_dispatch:

permissions:
  contents: write

jobs:
  dependency-submission:
    runs-on: ubuntu-latest
    if: github.repository == 'meshtastic/Meshtastic-Android'

    steps:
      - uses: actions/checkout@v5
      - uses: actions/setup-java@v5
        with:
          distribution: jetbrains
          java-version: 21

      - name: Generate and submit dependency graph
        uses: gradle/actions/dependency-submission@v5
        with:
          build-scan-publish: true
          build-scan-terms-of-use-url: "https://gradle.com/help/legal-terms-of-use"
          build-scan-terms-of-use-agree: "yes"