mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2025-12-13 13:11:43 +00:00
(cherry picked from commit db58024351e06c6ddc90d6143cae9133ddbbfedc) Signed-off-by: Andy Lee <andy.lee@suse.com> Co-authored-by: Andy Lee <andy.lee@suse.com>
This commit is contained in:
parent
7785d7f469
commit
58507f0b2e
19
.github/workflows/run-lint.yaml
vendored
19
.github/workflows/run-lint.yaml
vendored
@ -41,8 +41,14 @@ jobs:
|
||||
FROM="$GITHUB_BASE_SHA"
|
||||
TO="$GITHUB_HEAD_SHA"
|
||||
elif [ -n "$GITHUB_BEFORE" ] && [ -n "$GITHUB_AFTER" ]; then
|
||||
FROM="$GITHUB_BEFORE"
|
||||
TO="$GITHUB_AFTER"
|
||||
if [ "$GITHUB_BEFORE" = "0000000000000000000000000000000000000000" ]; then
|
||||
# first push to HEAD
|
||||
FROM=""
|
||||
TO="$GITHUB_AFTER"
|
||||
else
|
||||
FROM="$GITHUB_BEFORE"
|
||||
TO="$GITHUB_AFTER"
|
||||
fi
|
||||
else
|
||||
echo "No valid commit range found, skipping commitlint."
|
||||
exit 0
|
||||
@ -51,7 +57,14 @@ jobs:
|
||||
echo "FROM=$FROM"
|
||||
echo "TO=$TO"
|
||||
|
||||
npx commitlint --from "$FROM" --to "$TO" --verbose
|
||||
if [ -z "$FROM" ]; then
|
||||
echo "Linting last commit $TO"
|
||||
npx commitlint --last --verbose
|
||||
|
||||
else
|
||||
echo "Linting commits from $FROM to $TO"
|
||||
npx commitlint --from "$FROM" --to "$TO" --verbose
|
||||
fi
|
||||
env:
|
||||
GITHUB_EVENT_NAME: ${{ github.event_name }}
|
||||
GITHUB_BASE_SHA: ${{ github.event.pull_request.base.sha }}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user