Skip to content

nur_update

nur_update #1994

Workflow file for this run

name: Update NUR-search
on:
repository_dispatch:
types:
- nur_update
workflow_dispatch:
push:
branches:
- main
concurrency:
group: update
cancel-in-progress: false
jobs:
update_search:
runs-on: ubuntu-latest
if: github.event_name != 'push' || !endsWith(github.actor, '[bot]')
steps:
- id: get_workflow_token
uses: peter-murray/[email protected]
with:
application_id: '${{ secrets.GH_APPLICATION_ID }}'
application_private_key: '${{ secrets.GH_APPLICATION_PRIVATE_KEY }}'
permissions: "contents:write"
revoke_token: true
- uses: actions/checkout@v4
with:
repository: nix-community/NUR
- uses: actions/checkout@v4
with:
repository: nix-community/nur-combined
submodules: 'recursive'
path: nur-combined
- uses: actions/checkout@v4
with:
repository: nix-community/nur-search
path: nur-search
- uses: cachix/install-nix-action@v30
with:
nix_path: nixpkgs=channel:nixos-unstable
extra_nix_config: |
experimental-features = nix-command flakes
- name: update nur-search/data/packages.json
run: ./ci/update-nur-search.sh
env:
API_TOKEN_GITHUB: '${{ steps.get_workflow_token.outputs.token }}'
- name: rebase # TODO: fix upstream push-protected to retry when push fails
run: |
source ./ci/lib/setup-git.sh
git -C $GITHUB_WORKSPACE/nur-search fetch origin ${{ github.event.repository.default_branch }}
git -C $GITHUB_WORKSPACE/nur-search pull --rebase origin ${{ github.event.repository.default_branch }}
env:
GITHUB_TOKEN: ${{ steps.get_workflow_token.outputs.token }}
- uses: CasperWA/push-protected@v2
with:
token: ${{ steps.get_workflow_token.outputs.token }}
branch: ${{ github.event.repository.default_branch }}
path: nur-search