Update flake lock #631
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: Update flake lock | |
"on": | |
schedule: | |
- cron: 0 1 * * * | |
workflow_dispatch: | |
env: | |
BRANCH_NAME: auto-flake-update | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- name: Install nix | |
uses: DeterminateSystems/nix-installer-action@main | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Check out repository code | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.GH_TOKEN }} | |
- name: Create branch | |
run: | | |
git fetch | |
branch_exists=$(git branch --list "$BRANCH_NAME") | |
if [ -z "$branch_exists" ]; then | |
git checkout -b "$BRANCH_NAME" | |
else | |
git checkout "$BRANCH_NAME" | |
git reset --hard origin/master | |
fi | |
- name: Update lock | |
run: | | |
git config user.name 'github-actions' | |
git config user.email 'actions@github.com' | |
nix flake update --commit-lock-file | |
git push --force --set-upstream origin "$BRANCH_NAME" | |
- name: Open a PR | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
run: | | |
gh pr create \ | |
--base master \ | |
--head "$BRANCH_NAME" \ | |
--title "[Flake] Auto update lock" \ | |
--body "" \ | |
--label automated || exit 0 |