-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (29 loc) · 1 KB
/
Copy pathnaming-conventions.yml
File metadata and controls
35 lines (29 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: Enforce Handbook Naming Conventions
on:
create:
pull_request:
branches-ignore:
- 'dependabot/**'
jobs:
check-repo-name-conventions:
runs-on: ubuntu-latest
steps:
- name: Check repository name
run: |
REPO_NAME=${GITHUB_REPOSITORY##*/}
if [[ ! "$REPO_NAME" =~ ^([A-Z][A-Za-z0-9]*)(-[A-Z0-9][A-Za-z0-9]*)*$ ]]; then
echo "Repository name '$REPO_NAME' does not follow the naming convention established in the RSE Agile Method Handbook."
exit 1
fi
check-branch-name-conventions:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Check branch name
run: |
if [[ ! "$GITHUB_HEAD_REF" =~ ^[a-z0-9]+(-[a-z0-9]+)*$ ]]; then
echo "Branch name '$GITHUB_HEAD_REF' does not follow the naming convention established in the RSE Agile Method Handbook."
exit 1
fi