update-dependencies.yaml 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. # SPDX-FileCopyrightText: 2025 Christina Sørensen
  2. #
  3. # SPDX-License-Identifier: EUPL-1.2
  4. name: "Automated Dependency Bump"
  5. on:
  6. workflow_dispatch:
  7. schedule:
  8. - cron: '0 0 * * 4'
  9. jobs:
  10. update-and-create-pr:
  11. runs-on: ubuntu-latest
  12. concurrency:
  13. group: ${{ github.workflow }}-${{ github.ref }}
  14. cancel-in-progress: true
  15. steps:
  16. - name: "Checkout repository"
  17. uses: actions/checkout@v4
  18. with:
  19. fetch-depth: 0
  20. - name: "Install Nix"
  21. uses: cachix/install-nix-action@v22
  22. with:
  23. nix_path: nixpkgs=channel:nixos-unstable
  24. - name: "Set up Git credentials"
  25. run: |
  26. git config user.name "github-actions[bot]"
  27. git config user.email "github-actions[bot]@users.noreply.github.com"
  28. - name: "Run update script"
  29. id: run_script
  30. run: |
  31. chmod +x .github/workflows/update-dependencies.sh
  32. .github/workflows/update-dependencies.sh
  33. BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)
  34. echo "branch=${BRANCH_NAME}" >> $GITHUB_OUTPUT
  35. - name: "Create Pull Request"
  36. env:
  37. GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  38. run: |
  39. gh pr create \
  40. --title "build(deps): Automatic dependency updates for $(date --iso-8601)" \
  41. --body "This PR was automatically generated by a GitHub Action to update crate and flake dependencies. Please review the changes and merge." \
  42. --base main \
  43. --head ${{ steps.run_script.outputs.branch }}