Skip to content

Update lists

Update lists #26886

Workflow file for this run

name: Update lists
on:
schedule:
- cron: '15,45 * * * *' # Run every hour at 15 and 45 minutes past the hour
workflow_dispatch:
jobs:
update-lists:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 1
- name: Set up Python 3.
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: 3.13
- name: Install uv
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
- run: uv sync --frozen
- name: Generate list files
env:
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
run: |
mkdir newlists
uv run python update-lists.py --output-dir newlists
- name: Commit files
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git remote set-branches origin lists
git fetch --depth 1 origin lists
git switch lists
cp -rf newlists/* lists/ && rm -rf newlists
git add lists
git commit -m "Automatically updated lists: $(date)" -a || true
- name: Push changes
run: |
git remote add github "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY.git"
git push -u github lists
- name: notify-slack-failed
uses: slackapi/slack-github-action@af78098f536edbc4de71162a307590698245be95 # v3.0.1
if: failure()
env:
message: ":x:Adblock lists update job failed.\\n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: incoming-webhook
errors: true
payload: |
{
"channel": "${{ secrets.SLACK_CHANNEL_ID }}",
"text": "${{ env.message }}",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "${{ env.message }}"
}
}
]
}