-
Notifications
You must be signed in to change notification settings - Fork 3
45 lines (40 loc) · 1.37 KB
/
check.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# 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"