-
Notifications
You must be signed in to change notification settings - Fork 2
51 lines (39 loc) · 1.42 KB
/
naming_convention.yml
File metadata and controls
51 lines (39 loc) · 1.42 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: check naming convention
# renames any files or folders that are not following the convention
# convention for folders --> problem-{digit}
# convention for files --> script.{file_exention}
on:
push:
schedule:
# runs the cron job at 21:00 each Wednesday (after our meetings) UTC Time (23:00 EET)
- cron: '00 21 * * 3'
jobs:
rename-incorrect-entries:
runs-on: ubuntu-22.04
container:
image: python:3
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
# specified as a secret inside the repository
token: ${{ secrets.AUTOMATION_TOKEN }}
branch: main
- name: Execute rename_scripts.py and rename_folders.py
run: |
cd .github/scripts
python3 rename_scripts.py ${{ github.workspace }}
python3 rename_folders.py ${{ github.workspace }}
- name: Commit changes
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add -A
git diff-index --quiet HEAD || (git commit -m "bot: renaming file")
- name: Push changes
uses: ad-m/github-push-action@master
with:
# specified inside the repository
token: ${{ secrets.AUTOMATION_TOKEN }}
branch: main