diff --git a/.github/workflows/update-deps.yml b/.github/workflows/update-deps.yml new file mode 100644 index 000000000..fe0383cd7 --- /dev/null +++ b/.github/workflows/update-deps.yml @@ -0,0 +1,44 @@ +name: Update Dependencies + +on: + workflow_dispatch: + +permissions: + contents: write + pull-requests: write + +jobs: + update-deps: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Setup elan + run: | + curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf | sh -s -- -y + echo "$HOME/.elan/bin" >> "$GITHUB_PATH" + - name: Run lake update + run: lake update + - name: Check for changes + id: check_changes + run: | + if git diff --quiet; then + echo "has_changes=false" >> $GITHUB_OUTPUT + else + echo "has_changes=true" >> $GITHUB_OUTPUT + fi + + - name: Commit and create PR + if: steps.check_changes.outputs.has_changes == 'true' + uses: peter-evans/create-pull-request@v8 + with: + token: ${{ secrets.GITHUB_TOKEN }} + commit-message: "chore: Update dependencies at $(date +%Y/%m/%d)" + title: "chore: Update dependencies at $(date +%Y/%m/%d)" + branch: "update-deps-$(date +%s)" + delete-branch: true + body: | + Automated dependency updates via `lake update`. + + Please review the changes to `lake-manifest.json`.