Generates Layman Adlist every Month #92
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: Generates Layman Adlist every Month | |
on: | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: '0 0 1 * *' | |
jobs: | |
generate_layman_adlist: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get current date | |
id: date | |
run: echo "::set-output name=date::$(date)" | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Providing Execution permissions | |
shell: bash | |
run: chmod +x ./download_adlist_hosts.sh | |
- name: Run download_adlist_hosts.sh | |
shell: bash | |
run: | | |
./download_adlist_hosts.sh | |
- name: Setup Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.8 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
- name: Generate Layman Adlists | |
shell: bash | |
run: | | |
python ./layman_adlist_hosts_generator.py -d $(pwd)/bin/hosts -o $(pwd)/bin/layman_adlist_hosts.txt | |
- name: Copy new Layman adlist file | |
shell: bash | |
run: | | |
cp $(pwd)/bin/layman_adlist_hosts.txt $(pwd)/layman_adlist_hosts.txt | |
- name: Setup Git User | |
uses: fregante/setup-git-user@v1 | |
- name: git add | |
run: | | |
git add . | |
- name: Commit Latest | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
# Optional. Commit message for the created commit. | |
# Defaults to "Apply automatic changes" | |
commit_message: Generated Layman Adlist on ${{ steps.date.outputs.date }} | |
# Optional. Local and remote branch name where commit is going to be pushed | |
# to. Defaults to the current branch. | |
# You might need to set `create_branch: true` if the branch does not exist. | |
# branch: feature-123 | |
# Optional. Options used by `git-commit`. | |
# See https://git-scm.com/docs/git-commit#_options | |
commit_options: '--no-verify --signoff' | |
# Optional glob pattern of files which should be added to the commit | |
# Defaults to all (.) | |
# See the `pathspec`-documentation for git | |
# - https://git-scm.com/docs/git-add#Documentation/git-add.txt-ltpathspecgt82308203 | |
# - https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddefpathspecapathspec | |
# file_pattern: '*.php src/*.js tests/*.js' | |
# Optional. Local file path to the repository. | |
# Defaults to the root of the repository. | |
repository: . | |
# Optional commit user and author settings | |
# commit_user_name: My GitHub Actions Bot # defaults to "github-actions[bot]" | |
# commit_user_email: my-github-actions-bot@example.org # defaults to "github-actions[bot]@users.noreply.github.com" | |
# commit_author: Author <actions@github.com> # defaults to author of the commit that triggered the run | |
# Optional. Tag name being created in the local repository and | |
# pushed to remote repository and defined branch. | |
# tagging_message: 'v1.0.0' | |
# Optional. Option used by `git-status` to determine if the repository is | |
# dirty. See https://git-scm.com/docs/git-status#_options | |
status_options: '--untracked-files=no' | |
# Optional. Options used by `git-add`. | |
# See https://git-scm.com/docs/git-add#_options | |
add_options: '-u' | |
# Optional. Options used by `git-push`. | |
# See https://git-scm.com/docs/git-push#_options | |
push_options: '--force' | |
# Optional. Disable dirty check and always try to create a commit and push | |
skip_dirty_check: false | |
# Optional. Skip internal call to `git fetch` | |
skip_fetch: true | |
# Optional. Skip internal call to `git checkout` | |
skip_checkout: true | |
# Optional. Prevents the shell from expanding filenames. | |
# Details: https://www.gnu.org/software/bash/manual/html_node/Filename-Expansion.html | |
disable_globbing: true | |
# Optional. Create given branch name in local and remote repository. | |
create_branch: true |