[mefinity] Update #37
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update Domain | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
copy_domains: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Git | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "GitHub Actions" | |
git remote set-url origin "https://${{ secrets.GH_TOKEN }}@github.com/lepasid/blocklist.git" | |
- name: Set up time zone | |
run: echo "TZ=Asia/Jakarta" >> $GITHUB_ENV | |
- name: Copy and Update Domains | |
run: | | |
FILE_NAME=$(date +"%Y-%m-%d") | |
git fetch origin | |
git checkout main | |
cp domains "$FILE_NAME" | |
git checkout -b update-$FILE_NAME | |
git add "$FILE_NAME" | |
git commit -m "Update on $FILE_NAME" | |
git fetch origin 2024 | |
git merge origin/2024 --allow-unrelated-histories | |
git push origin update-$FILE_NAME:2024 |