mirror of
https://github.com/wentasah/ros2nix.git
synced 2025-06-09 15:52:23 +03:00
Update rosdistro only when necessary
This commit is contained in:
parent
2fd2d627ae
commit
ee76acc9c9
1 changed files with 21 additions and 2 deletions
23
.github/workflows/update.yml
vendored
23
.github/workflows/update.yml
vendored
|
@ -1,7 +1,7 @@
|
|||
name: Update rosdistro
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 12 * * FRI"
|
||||
- cron: "0 12 * * *"
|
||||
workflow_dispatch:
|
||||
jobs:
|
||||
update:
|
||||
|
@ -15,7 +15,26 @@ jobs:
|
|||
git config user.email 'github-actions[bot]@users.noreply.github.com'
|
||||
- name: Update rosdistro
|
||||
run: |
|
||||
nix flake update rosdistro --commit-lock-file
|
||||
nix build .#rosdistro --out-link /tmp/rosdistro-old
|
||||
nix flake update rosdistro
|
||||
nix build .#rosdistro --out-link /tmp/rosdistro-new
|
||||
grep -Rh nixos: /tmp/rosdistro-old > /tmp/rosdistro-old.txt
|
||||
grep -Rh nixos: /tmp/rosdistro-new > /tmp/rosdistro-new.txt
|
||||
git reset --hard
|
||||
if ! git diff /tmp/rosdistro-old.txt /tmp/rosdistro-new.txt > /tmp/rosdistro-diff; then
|
||||
# redo update with nice commit message
|
||||
nix flake update rosdistro --commit-lock-file
|
||||
GIT_EDITOR='sed -i -e "1crosdistro update"' git commit --amend
|
||||
GIT_EDITOR='sed -i -e "\$R/tmp/rosdistro-diff"' git commit --amend
|
||||
cat <<EOF > /tmp/.body
|
||||
Diff:
|
||||
```diff
|
||||
$(cat /tmp/rosdistro-diff)
|
||||
```
|
||||
EOF
|
||||
else
|
||||
echo "No relevant changes"
|
||||
fi
|
||||
git show --format='%b' --no-patch > /tmp/.body
|
||||
- name: Create Pull Request
|
||||
uses: peter-evans/create-pull-request@v7
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue