Download the latest fallback-paths.nix #6
Workflow file for this run
This file contains 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: Download the latest fallback-paths.nix | |
on: | |
workflow_dispatch: | |
jobs: | |
sync: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: "actions/checkout@v3" | |
- uses: "DeterminateSystems/nix-installer-action@main" | |
- uses: "DeterminateSystems/magic-nix-cache-action@main" | |
- run: | | |
echo "GIT_AUTHOR_NAME=github-actions-bot" >> $GITHUB_ENV | |
echo "GIT_AUTHOR_EMAIL=<[email protected]>" >> $GITHUB_ENV | |
echo "GIT_COMMITTER_NAME=github-actions-bot" >> $GITHUB_ENV | |
echo "GIT_COMMITTER_EMAIL=<[email protected]>" >> $GITHUB_ENV | |
- run: | | |
set -eux | |
url=$( | |
nix run https://flakehub.com/f/DeterminateSystems/fh/0.1.9.tar.gz --\ | |
list versions --json NixOS/nix '*' \ | |
| nix run nixpkgs#jq -- -r '.[-1] | "https://releases.nixos.org/nix/nix-" + .version + "/fallback-paths.nix"') | |
( | |
echo "# Mirrored from $url" | |
echo "# via https://github.com/DeterminateSystems/nix-upgrade" | |
echo "" | |
curl "$url" | |
) > versions.nix | |
# check it evals | |
nix eval --json -f ./versions.nix | |
git add versions.nix | |
git commit -m "$url" | |
echo "SOURCE_URL=$url" >> $GITHUB_ENV | |
- name: Create PR | |
id: create-pr | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
base: main | |
branch: update | |
delete-branch: true | |
token: ${{ github.token }} | |
title: ${{ env.SOURCE_URL }} |