github.com/chainreactors/fingers@v1.2.1/.github/workflows/update-fingerprints.yml (about)

     1  name: Update Fingerprint Resources
     2  
     3  on:
     4    push:
     5      tags:
     6        - 'v*'  # 触发格式: v1.0.0, v1.1.1, v2.0.0 等
     7    workflow_dispatch: # 允许手动触发
     8  
     9  jobs:
    10    update-fingerprints:
    11      runs-on: ubuntu-latest
    12  
    13      steps:
    14        - name: Checkout repository
    15          uses: actions/checkout@v4
    16          with:
    17            token: ${{ secrets.GITHUB_TOKEN }}
    18            fetch-depth: 1
    19  
    20        - name: Setup Go
    21          uses: actions/setup-go@v5
    22          with:
    23            go-version: '1.21'
    24            cache: true
    25  
    26        - name: Create refer directory and clone templates
    27          run: |
    28            mkdir -p refer
    29            git clone --depth 1 https://github.com/chainreactors/templates refer/templates
    30            echo "✓ Templates repository cloned"
    31  
    32        - name: Download and transform all fingerprints
    33          run: |
    34            echo "Starting fingerprint update process..."
    35            go run cmd/transform/transform.go update
    36  
    37        - name: Check for changes
    38          id: check_changes
    39          run: |
    40            git diff --quiet resources/ || echo "changes=true" >> $GITHUB_OUTPUT
    41            git status resources/
    42  
    43        - name: Commit and push changes
    44          if: steps.check_changes.outputs.changes == 'true'
    45          run: |
    46            git config --local user.email "github-actions[bot]@users.noreply.github.com"
    47            git config --local user.name "github-actions[bot]"
    48            git add resources/*.gz
    49            git commit -m "chore: update fingerprint resources
    50  
    51            Auto-updated by GitHub Actions
    52            - nmap-service-probes
    53            - nmap-services
    54            - fingerprinthub v4 (web & service)
    55            - wappalyzer
    56            - ehole
    57            - goby
    58            - fingers (http & socket)
    59  
    60            Timestamp: $(date -u +'%Y-%m-%d %H:%M:%S UTC')"
    61            git push
    62  
    63        - name: Create summary
    64          if: always()
    65          run: |
    66            echo "## Fingerprint Update Summary" >> $GITHUB_STEP_SUMMARY
    67            echo "" >> $GITHUB_STEP_SUMMARY
    68            echo "### Updated Resources" >> $GITHUB_STEP_SUMMARY
    69            ls -lh resources/*.gz | awk '{print "- " $9 ": " $5}' >> $GITHUB_STEP_SUMMARY
    70            echo "" >> $GITHUB_STEP_SUMMARY
    71            echo "Update completed at: $(date -u +'%Y-%m-%d %H:%M:%S UTC')" >> $GITHUB_STEP_SUMMARY