Skip to content

Test new gen

Test new gen #10003

Workflow file for this run

name: Test new gen
on:
schedule:
- cron: '0 * * * *'
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
jobs:
Generate-Blacklist:
runs-on: ubuntu-latest
steps:
- name: Setup Git Configurations
run: |
git config --global user.email "[email protected]"
git config --global user.name "github-actions[bot]"
- name: Check out repository code
uses: actions/checkout@v4
with:
fetch-depth: 1 # Fetch all history for completeness
ref: main
token: ${{ secrets.PAT }}
- name: Generate blacklist
run: sudo /bin/bash generate_fqdn_v2.sh # output: all.fqdn.blacklist
- name: Extract current blacklist.txt
run: |
mkdir current
mv all.fqdn.blacklist current/all.fqdn.blacklist
mv current/all.fqdn.blacklist current/blacklist.txt
- name: Count domains in blacklist
id: count_domains
run: |
count=$(wc -l < current/blacklist.txt)
echo "Number of domains: $count"
echo "::set-output name=count::$count"
- name: Delete Release if Exists
run: |
release_id=$(curl -H "Authorization: token ${{ secrets.PAT }}" -s "https://api.github.com/repos/$GITHUB_REPOSITORY/releases/tags/latest" | jq .id)
if [ "$release_id" != "null" ]; then
curl -X DELETE -H "Authorization: token ${{ secrets.PAT }}" "https://api.github.com/repos/$GITHUB_REPOSITORY/releases/$release_id"
fi
- name: Create Release
id: create_release
uses: actions/create-release@v1
with:
tag_name: latest
release_name: "Domains Blacklist"
body: "Domains: ${{ steps.count_domains.outputs.count }}"
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
- name: Upload Release Asset (Blacklist)
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./current/blacklist.txt
asset_name: blacklist.txt
asset_content_type: text/plain
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
- name: Clean up
run: rm -r current
env:
GITHUB_TOKEN: ${{ secrets.PAT }}