Skip to content

Update copy.yml

Update copy.yml #36

Workflow file for this run

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