name: PR Branch Suggestion on: pull_request_target: types: [opened] branches: - master jobs: suggest-branch: runs-on: ubuntu-latest permissions: pull-requests: write steps: - name: Suggest maintenance branch uses: actions/github-script@v7 with: script: | const comment = `### Branch Targeting Suggestion You've targeted the \`master\` branch with this PR. Please consider if a version branch might be more appropriate: - **\`maintenance-9.x\`** - If your change is backward-compatible and won't create compatibility issues between INAV firmware and Configurator 9.x versions. This will allow your PR to be included in the next 9.x release. - **\`maintenance-10.x\`** - If your change introduces compatibility requirements between firmware and configurator that would break 9.x compatibility. This is for PRs which will be included in INAV 10.x If \`master\` is the correct target for this change, no action is needed. --- *This is an automated suggestion to help route contributions to the appropriate branch.*`; try { await github.rest.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, body: comment }); } catch (err) { core.setFailed(`Failed to post suggestion comment: ${err}`); }