Skip to content

Commit

Permalink
try new ci
Browse files Browse the repository at this point in the history
  • Loading branch information
sbryngelson committed Jan 9, 2024
1 parent caea913 commit 1dda8be
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/count-2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Check Line Counts
on:
pull_request_target:

jobs:
checkbranch:
name: Check PR Branch status
runs-on: ubuntu-latest
outputs:
branchstat: ${{ steps.brstat.outputs.stat}}
steps:
- name: Check code from PR branch
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Check whether branch is up-to-date
id: brstat
run: |
git remote add MFC https://github.com/MFlowCode/MFC
git fetch MFC master
echo "${{ github.event.pull_request.head.sha }}"
git rev-list --left-right --count MFC/master...${{ github.event.pull_request.head.sha }} | awk '{print "Behind "$1" - Ahead "$2""}'
count=$(git rev-list --left-right --count MFC/master...${{ github.event.pull_request.head.sha }} | awk '{print $1}')
if [ $count -gt 0 ]
then
echo "Current branch is behind MFC master branch!"
echo "stat=true" >> "$GITHUB_OUTPUT"
else
echo "stat=false" >> "$GITHUB_OUTPUT"
fi

0 comments on commit 1dda8be

Please sign in to comment.