Skip to content

Commit

Permalink
move into own workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
assignUser committed Nov 13, 2024
1 parent 81a39b5 commit 09b9c82
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 22 deletions.
22 changes: 0 additions & 22 deletions .github/workflows/preliminary_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,25 +76,3 @@ jobs:
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
exit 1
fi
title-check:
name: CC Titel
runs-on: ubuntu-latest
# Run this on every commit for now to notify existing PRs after they rebase
# if: ${{ github.event.action == 'opened' || github.event.action == 'edited' }}
steps:
- shell: python
env:
title: "${{ github.event.pull_request.title }}"
run: |
import re
import os
title = os.environ["title"]
title_re = r"^(feat|fix|build|test|docs|refactor|misc)(\(.+\))?: (.+)"
match = re.search(title_re, title)
if match is None:
print("::error::Please follow conventional commit guidelines in CONTRIBUTING.md: https://github.com/facebookincubator/velox/blob/main/CONTRIBUTING.md#commit-messages")
exit(1)
else:
exit(0)
50 changes: 50 additions & 0 deletions .github/workflows/title_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Copyright (c) Facebook, Inc. and its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Run Checks

on:
pull_request:
types:
- opened
- reopened
- synchronize # run on every commit for now
- edited

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.repository }}-${{ github.head_ref || github.sha }}
cancel-in-progress: true

jobs:
title-check:
name: PR Titel Check
runs-on: ubuntu-latest
steps:
- shell: python
env:
title: "${{ github.event.pull_request.title }}"
run: |
import re
import os
title = os.environ["title"]
title_re = r"^(feat|fix|build|test|docs|refactor|misc)(\(.+\))?: (.+)"
match = re.search(title_re, title)
if match is None:
print("::error::Please follow conventional commit guidelines in CONTRIBUTING.md: https://github.com/facebookincubator/velox/blob/main/CONTRIBUTING.md#commit-messages")
exit(1)
else:
exit(0)

0 comments on commit 09b9c82

Please sign in to comment.