-
Notifications
You must be signed in to change notification settings - Fork 5
39 lines (33 loc) · 1.09 KB
/
CopyCertificate.yml
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
name: Move .cer Files to "All Certs Uncategorized"
on:
push:
paths:
- '**/*.cer' # Trigger on any .cer file
jobs:
move-certs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Move .cer files
run: |
target_dir="All Certs Uncategorized"
mkdir -p "$target_dir"
# Find all .cer files except those already in the target directory
for file in $(find . -name "*.cer" ! -path "./$target_dir/*"); do
filename=$(basename "$file")
if [ ! -f "$target_dir/$filename" ]; then
mv '${file}' '${target_dir}/'
else
echo "File $filename already exists in $target_dir. Skipping..."
fi
done
- name: Commit changes
run: |
git config --global user.name 'github-actions'
git config --global user.email '[email protected]'
git add "$target_dir/"
git commit -m "Move .cer files to All Certs Uncategorized"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}