dependencies #1433
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
name: dependencies | |
on: | |
schedule: | |
- cron: "29 7 * * *" | |
workflow_dispatch: | |
jobs: | |
dependencies: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-java@v1 | |
with: | |
java-version: '11' | |
- name: Install Clojure CLI | |
uses: DeLaGuardo/setup-clojure@master | |
with: | |
cli: '1.10.3.933' | |
lein: 2.9.5 | |
- name: check for outdated dependencies | |
id: deps | |
run: | | |
echo 'Scheduled outdated dependency check:' >> outdated.md | |
echo '```clojure' >> outdated.md | |
clojure -M:outdated >> outdated.md | |
echo '```' >> outdated.md | |
cat outdated.md | |
if [ $(grep -c ':mvn/version' outdated.md) -gt 0 ]; then echo ::set-output name=status::failure; else echo ::set-output name=status::success; fi | |
rm outdated.md | |
- if: ${{ steps.deps.outputs.status == 'failure' }} | |
name: Badge | |
uses: RubbaBoy/[email protected] | |
with: | |
NAME: dependencies | |
LABEL: 'dependencies' | |
STATUS: "out of date" | |
COLOR: red | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- if: ${{ steps.deps.outputs.status == 'success' }} | |
name: Badge | |
uses: RubbaBoy/[email protected] | |
with: | |
NAME: dependencies | |
LABEL: 'dependencies' | |
STATUS: 'up to date' | |
COLOR: green | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- if: ${{ steps.deps.outputs.status == 'failure' }} | |
name: Update stale dependencies | |
run: | | |
clojure -M:outdated --write | |
lein ancient upgrade :no-tests | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v3 | |
with: | |
commit-message: Update stale dependencies | |
title: Update stale dependencies | |
branch: update-dependencies | |
base: main |