Skip to content

license-update

license-update #2

name: license-update
on:
schedule:
- cron: '0 21 * * 5' # Every Friday at 9 PM
workflow_dispatch:
jobs:
update-license:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Git user
run: |
git config --global user.email "${{ secrets.EMAIL }}"
git config --global user.name "${{ secrets.USER_NAME }}"
- name: Check if it is the 2nd or 4th Friday
run: |
WEEK_NUMBER=$(date +\"%U\")
if [ $((WEEK_NUMBER % 2)) -ne 0 ]; then
echo \"Not the 2nd or 4th Friday. Skipping.\"
exit 0
fi
- name: Update LICENSE and README.md
run: |
chmod +x ./scripts/license-update.sh
./scripts/license-update.sh
- name: Commit and push changes
run: |
git add LICENSE README.md
git commit -m "Updated License and ReadMe files"
git push origin $(git rev-parse --abbrev-ref HEAD)