Update Channel Info #149049
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: "Update Channel Info" | |
| on: | |
| schedule: | |
| - cron: '*/10 * * * *' | |
| workflow_dispatch: | |
| jobs: | |
| update: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Check out repository (main) | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| path: main | |
| ref: main | |
| persist-credentials: true # required for pushing | |
| - name: Check out repository (archive) | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| path: archive | |
| ref: archive | |
| persist-credentials: true # required for pushing | |
| - name: Configure Git | |
| run: | | |
| git -C archive config user.name github-actions | |
| git -C archive config user.email github-actions@github.com | |
| git -C main config user.name github-actions | |
| git -C main config user.email github-actions@github.com | |
| - name: fetch from cache | |
| uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 | |
| with: | |
| path: updater.bundle | |
| key: ${{ runner.os }}-bundle-${{ hashFiles('main/**/flake.lock') }}-${{ hashFiles('main/**/*.nix') }}-${{ hashFiles('main/**/*.nim*') }} | |
| - name: enable userns so the bundle can use unshare() | |
| run: | | |
| sudo sysctl -w kernel.unprivileged_userns_clone=1 | |
| sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 | |
| sudo sysctl -w kernel.apparmor_restrict_unprivileged_unconfined=0 | |
| - name: update JSON | |
| run: | | |
| ./updater.bundle -d:$PWD/archive && cp archive/*.json main/. | |
| - name: create commits | |
| run: | | |
| rm ./updater.bundle | |
| git -C archive commit -a -m "update sources.json" || true | |
| git -C main commit -a -m "update sources.json" || true | |
| - name: Push commits with updated inputs | |
| run: | | |
| git -C archive pull --rebase --autostash && git -C archive push | |
| git -C main pull --rebase --autostash && git -C main push |