Skip to content

github: compliance: use shallow fetches #64517

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .github/workflows/compliance.yml
Original file line number Diff line number Diff line change
@@ -15,7 +15,6 @@ jobs:
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0

- name: cache-pip
uses: actions/cache@v3
@@ -37,12 +36,21 @@ jobs:
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
git remote -v

git log --oneline --decorate -100

git fetch --deepen=${{ github.event.pull_request.commits }} origin ${{ github.event.pull_request.head.sha }}
git log --oneline --decorate -100

git fetch origin ${BASE_REF}
git log --graph --oneline --decorate ${{ github.event.pull_request.head.sha }} origin/${BASE_REF} -100

# Ensure there's no merge commits in the PR
[[ "$(git rev-list --merges --count origin/${BASE_REF}..)" == "0" ]] || \
(echo "::error ::Merge commits not allowed, rebase instead";false)
git rebase origin/${BASE_REF}
# debug
git log --pretty=oneline | head -n 10
git log --oneline --decorate -100
west init -l . || true
west config manifest.group-filter -- +ci,+optional
west update 2>&1 1> west.update.log || west update 2>&1 1> west.update2.log