Skip to content

Update Heartfelt Sayings [html] #242

Update Heartfelt Sayings [html]

Update Heartfelt Sayings [html] #242

name: Check and Rename Files
on:
push:
branches:
- 'main'
jobs:
check-and-rename:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install dependencies
run: sudo apt-get install -y rename
- name: Check and rename files
run: |
for file in $(find . -type f -name '*-*-*-*'); do
if [[ $file =~ ^.*-([0-9]{4}-[0-9]{2}-[0-9]{2}).*$ ]]; then
new_file=$(echo $file | sed -r 's/-[0-9]{4}-[0-9]{2}-[0-9]{2}//')
cp $file $new_file
fi
done
- name: Commit and push changes
run: |
git config --global user.name 'GitHub Actions'
git config --global user.email 'github-actions@github.com'
git add .
git commit -m "Copy and Rename files"
git push