Update #596
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 | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 * * *" | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Nix | |
uses: cachix/install-nix-action@v17 | |
with: | |
nix_path: nixpkgs=channel:nixpkgs-unstable | |
extra_nix_config: | | |
experimental-features = nix-command flakes | |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} | |
- name: Add SSH Key | |
run: | | |
mkdir -p "$HOME/.ssh" | |
echo "${{ secrets.PERSONAL_SSH_KEY }}" > "$HOME/.ssh/id_ed25519" | |
chmod 600 "$HOME/.ssh/id_ed25519" | |
- name: Update dependencies | |
run: | | |
# programs | |
./scripts/auto-update-modules.py | |
git add --all && git diff-index --quiet HEAD || git commit -m "chore: Update vscode extensions" -m "VSCode extensions file updates" | |
# nix flake lock (root) | |
nix flake update --commit-lock-file --commit-lockfile-summary "chore(root): Update flake lock" | |
env: | |
GIT_AUTHOR_NAME: github-actions[bot] | |
GIT_AUTHOR_EMAIL: <github-actions[bot]@users.noreply.github.com> | |
GIT_COMMITTER_NAME: github-actions[bot] | |
GIT_COMMITTER_EMAIL: <github-actions[bot]@users.noreply.github.com> | |
- id: commit-msg | |
run: | | |
content="$(git show -s --format=%b)" | |
content="${content//$'\n'/'%0A'}" | |
content="${content//$'\r'/'%0D'}" | |
echo "::set-output name=content::$content" | |
- name: Create PR | |
uses: peter-evans/create-pull-request@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
branch: "feature/ci-version-up" | |
delete-branch: true | |
title: "feat: Update dependencies" | |
body: | | |
###### Automated update by the [GitHub Workflows](https://github.com/sudosubin/nixos-config/blob/main/.github/workflows/update.yaml) pipeline. | |
```sh | |
${{ steps.commit-msg.outputs.content }} | |
``` |