Import ShadowWhisperer #6326
This file contains hidden or 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: Import ShadowWhisperer | |
| on: | |
| schedule: | |
| - cron: "*/59 * * * *" | |
| env: | |
| GIT_NAME: "${{ secrets.GIT_NAME }}" | |
| GIT_EMAIL: "${{ secrets.GIT_EMAIL }}" | |
| GH_TOKEN: "${{ secrets.GH_TOKEN }}" | |
| jobs: | |
| import: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@main | |
| name: Clone repository | |
| with: | |
| token: "${{ secrets.GITHUB_TOKEN }}" | |
| fetch-depth: 2 | |
| - name: Set up Python | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: "3.x" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| python3 --version | |
| # - name: Download ShadowWhisperer Adult list | |
| # run: | | |
| # curl --retry 5 -sSLo ${{ github.workspace }}/source/porn_filters/imported/adult.ShadowWhisperer https://raw.githubusercontent.com/ShadowWhisperer/BlockLists/master/RAW/Adult | |
| - name: List the Import dir | |
| run: | | |
| ls -lhA ${{ github.workspace }}/source/porn_filters/imported | |
| - name: Compare and output unique lines | |
| run: | | |
| bash ${{ github.workspace }}/scripts/shadowwhisperer.sh | |
| - name: List the Import dir | |
| run: | | |
| ls -lhA ${{ github.workspace }}/source/porn_filters/imported | |
| - name: Commit changes | |
| continue-on-error: true | |
| run: | | |
| tag=$(date +'day: %j of year %Y %H:%M:%S') | |
| git config --global user.email "${{ secrets.GIT_NAME }}" | |
| git config --global user.name "${{ secrets.GIT_NAME }}`" | |
| git commit -m "Committed new lists $tag" -a | |
| git pull --rebase | |
| - name: Git Status | |
| run: git status | |
| - name: Push changes | |
| continue-on-error: true | |
| uses: ad-m/github-push-action@master | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| branch: ${{ github.ref }} | |
| - name: Notify mirror workflow | |
| run: | | |
| curl -X POST -H "Authorization: token ${GH_TOKEN}" \ | |
| -H "Accept: application/vnd.github+json" \ | |
| https://api.github.com/repos/${{ github.repository }}/dispatches \ | |
| -d '{"event_type":"shadowwhisperer.updated"}' |