Skip to content

Feature/based on vnext/1.43 #17

Feature/based on vnext/1.43

Feature/based on vnext/1.43 #17

Workflow file for this run

name: Check Commits
on:
pull_request:
types:
- opened
- synchronize
jobs:
check-commits:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: fetch
run: git fetch
- name: Get list of vnext branches
id: get-branches
run: |
branches=$(git branch -r | grep 'origin/vnext/*' | sed 's/origin\///')
echo "::set-output name=branches::$branches"
- name: Check commit hashes
id: check-commits
run: |
branches="${{ steps.get-branches.outputs.branches }}"
commit_hashes=$(git log --pretty=format:"%H" ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }})
for hash in $commit_hashes; do
for branch in $branches; do
if git merge-base --is-ancestor $hash origin/$branch; then
echo "Error: Commit hash $hash found in branch $branch"
exit 1
fi
done
done
echo "All commit hashes are valid."
- name: Echo success message
if: steps.check-commits.outcome == 'success'
run: echo "Workflow completed successfully."