fixup! test #134
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
# SPDX-FileCopyrightText: 2023 Serokell <https://serokell.io/> | ||
# | ||
# SPDX-License-Identifier: MPL-2.0 | ||
name: Nix flake check | ||
on: push | ||
jobs: | ||
check-outdated: | ||
runs-on: [self-hosted, nix] | ||
outputs: | ||
msg: ${{ steps.outdated.outputs.outdated }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: check outdated packages | ||
id: outdated | ||
run: | | ||
function output { | ||
echo "outdated<<EOF" >> $GITHUB_OUTPUT | ||
echo "Repository https://github.com/${{ github.repository }} has outdated haskell dependencies" >> $GITHUB_OUTPUT | ||
echo "$msg" >> $GITHUB_OUTPUT | ||
echo "EOF" >> $GITHUB_OUTPUT | ||
} | ||
nix develop .#ci -c cabal update | ||
trap 'output' ERR | ||
msg=$(nix develop .#ci -c cabal outdated --exit-code) | ||
report-outdated: | ||
runs-on: [self-hosted, nix] | ||
if: failure() | ||
needs: check-outdated | ||
steps: | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Report outdated haskell dependencies | ||
env: | ||
MSG: ${{needs.check-outdated.outputs.msg}} | ||
run: | | ||
nix develop .#ci -c curl -XPOST https://slack.com/api/chat.postMessage \ | ||
-H "Authorization: Bearer ${{ env.SLACK_TOKEN }}" \ | ||
# you can change 'libraries' to the channel dedicated to the library, if there is one | ||
-d "channel=libraries" \ | ||
-d "text=$MSG" |