summaryrefslogtreecommitdiff
path: root/.github/workflows/data-update.yml
blob: 39893127d5af327f7a138ac8d673f6d0a2a9797b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: "Update searx.data"
on:  # yamllint disable-line rule:truthy
  schedule:
    - cron: "59 23 28 * *"
  workflow_dispatch:

jobs:
  updateData:
    name: Update data - ${{ matrix.fetch }}
    runs-on: ubuntu-24.04
    if: ${{ github.repository_owner == 'searxng'}}
    strategy:
      fail-fast: false
      matrix:
        fetch:
          - update_ahmia_blacklist.py
          - update_currencies.py
          - update_external_bangs.py
          - update_firefox_version.py
          - update_engine_traits.py
          - update_wikidata_units.py
          - update_engine_descriptions.py
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Install Ubuntu packages
        run: |
          sudo ./utils/searxng.sh install packages

      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: '3.12'
          architecture: 'x64'

      - name: Install Python dependencies
        run: |
          make V=1 install

      - name: Fetch data
        env:
          FETCH_SCRIPT: ./searxng_extra/update/${{ matrix.fetch }}
        run: |
          V=1 ./manage pyenv.cmd python "$FETCH_SCRIPT"

      - name: Create Pull Request
        id: cpr
        uses: peter-evans/create-pull-request@v6
        with:
          commit-message: '[data] update searx.data - ${{ matrix.fetch }}'
          committer: searxng-bot <noreply@github.com>
          author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
          signoff: false
          branch: update_data_${{ matrix.fetch }}
          delete-branch: true
          draft: false
          title: '[data] update searx.data - ${{ matrix.fetch }}'
          body: |
            update searx.data - ${{ matrix.fetch }}
          labels: |
            data

      - name: Check outputs
        run: |
          echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
          echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"