-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (43 loc) · 1.5 KB
/
fix-cargo.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# This action fixes an issue with Nix, crates, and cargo
# Recp is a crate that depends on `recipe-parser`, another crate
# But in order to use `recipe-parser` in crates.io we need to specify the version
# To update the version, we use .cz.toml
# when the version is updated, the Cargo.lock is not, and when you try to install
# using nix, things go wrong.
# This action updates the lock file when they are bumped
# Because it's using the GITHUB_TOKEN, it doesn't trigger any workflow
name: Fix cargo for nix
on:
push:
branches:
- main
jobs:
bump-version:
if: "startsWith(github.event.head_commit.message, 'bump:')"
runs-on: ubuntu-latest
name: "Bump version and create changelog with commitizen"
permissions:
actions: write
contents: write
steps:
- name: Check out
uses: actions/checkout@v4
with:
fetch-depth: 0
token: "${{ secrets.GITHUB_TOKEN }}"
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Update Cargo.lock
uses: actions-rs/cargo@v1
with:
command: generate-lockfile
- name: Commit and push Cargo.lock
run: |
rm -rf .git/COMMIT_EDITMSG``
git config --global --add safe.directory "*"
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add Cargo.lock
git commit -m 'ci: update Cargo.lock'
git push