forked from ami-iit/jaxsim
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a scheduled workflow to automatically update the pixilock file (#8)
* Update `pixi` lockfile in CI * Use uniquely named branches when opening PRs * Install `pixi-diff-to-markdown` via `pixi`
- Loading branch information
1 parent
713bcb0
commit 1ec0794
Showing
1 changed file
with
57 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: Update pixi lockfile | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: 0 5 1 * * | ||
|
||
jobs: | ||
pixi-update: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
lfs: true | ||
|
||
- name: Set up pixi | ||
uses: prefix-dev/[email protected] | ||
with: | ||
run-install: false | ||
|
||
- name: Install pixi-diff-to-markdown | ||
run: pixi global install pixi-diff-to-markdown | ||
|
||
- name: Update pixi lockfile and generate diff | ||
run: | | ||
set -o pipefail | ||
pixi update --json --no-install | pixi exec pixi-diff-to-markdown --explicit-column=true --hide=false > diff.md | ||
- name: Configure Git for LFS | ||
run: | | ||
git lfs install | ||
git config --global user.name 'github-actions' | ||
git config --global user.email '[email protected]' | ||
- name: Commit and push changes | ||
run: | | ||
BRANCH_NAME="update-pixi-$(date +'%Y%m%d%H%M%S')" | ||
git checkout -b "$BRANCH_NAME" | ||
git add pixi.lock | ||
git commit -m "Update pixi.lock file" | ||
git push origin HEAD:"$BRANCH_NAME" | ||
- name: Create pull request | ||
uses: peter-evans/create-pull-request@v6 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
commit-message: This PR updates the `pixi` lockfile. | ||
title: Update `pixi` lockfile | ||
body-path: diff.md | ||
branch: ${{ github.ref_name }} | ||
base: main | ||
labels: pixi | ||
delete-branch: true |