Skip to content

Added MAVLink 2.0 message signing and authentication support to provide secure communication between GCS and flight controller. #270

Added MAVLink 2.0 message signing and authentication support to provide secure communication between GCS and flight controller.

Added MAVLink 2.0 message signing and authentication support to provide secure communication between GCS and flight controller. #270

name: Fail on Malformed Commits in PR Branch
# brazenly copied from ArduPilot's test_branch_conventions.yml
on:
pull_request:
types: [opened, synchronize, reopened]
permissions:
contents: read
jobs:
check-merge-commits:
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
with:
egress-policy: audit
- name: Checkout PR branch
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0
- name: Fetch base branch
run: |
git remote -v
git remote add upstream ${{ github.event.pull_request.base.repo.clone_url }}
git fetch upstream ${{ github.base_ref }}
git show upstream/${{ github.base_ref }}
- name: Check for merge commits in PR branch
run: |
# Find merge-base between base branch and (rebased) PR branch
echo "Merge target is origin/${{ github.base_ref }}"
echo "github.event.pull_request.base.ref=${{ github.event.pull_request.base.ref }} "
# Look for merge commits in PR branch only
MERGE_COMMITS=$(git log upstream/${{ github.base_ref }}..HEAD --merges --oneline)
echo "Merge commits:"
echo "$MERGE_COMMITS"
if [[ -n "$MERGE_COMMITS" ]]; then
echo "❌ Merge commits detected in the PR branch (not allowed):"
echo "Please see https://github.com/ArduPilot/MethodicConfigurator/blob/master/CONTRIBUTING.md"
exit 1
else
echo "✅ No merge commits found in the PR branch."
fi
# Look for fixup! commits in PR branch only
COMMITS=$(git log upstream/${{ github.base_ref }}..HEAD --oneline)
echo "Commits:"
echo "$COMMITS"
if [[ "$COMMITS" == *"fixup!"* ]]; then
echo "❌ fixup commits detected in the PR branch (not allowed):"
echo "$COMMITS"
echo "Please see https://github.com/ArduPilot/MethodicConfigurator/blob/master/CONTRIBUTING.md"
exit 1
else
echo "✅ No fixup commits found in the PR branch."
fi