pkgcheck.yml: notify on recoveries too

Signed-off-by: Anna (cybertailor) Vyalkova <cyber+gentoo@sysrq.in>
This commit is contained in:
Anna (cybertailor) Vyalkova
2023-05-18 13:09:21 +05:00
parent 02cc2f0922
commit 69cbd3bb1b

View File

@@ -12,18 +12,41 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Prepare job
run: |
LAST_STATUS=$(gh run list -R ${GITHUB_REPOSITORY} \
--branch=dev \
--workflow=pkgcheck.yml \
--status=completed \
--json=event,conclusion \
--jq='first(.[] | select(.event != "pull_request")).conclusion'
)
IRC_NOTIFY=${{ github.repository == 'gentoo/guru' && github.event_name != 'pull_request' }}
echo "last_status=${LAST_STATUS}" >> "${GITHUB_ENV}"
echo "irc_notify=${IRC_NOTIFY}" >> "${GITHUB_ENV}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check out repository
uses: actions/checkout@v3
with:
ref: dev
- name: Run pkgcheck
uses: pkgcore/pkgcheck-action@v1
with:
args: --keywords=-RedundantVersion,-NonsolvableDepsInDev
- name: Inform on IRC
if: ${{ failure() && github.repository == 'gentoo/guru' && github.event_name != 'pull_request' }}
- name: Inform failure on IRC
if: ${{ failure() && env.last_status == 'success' && fromJSON(env.irc_notify) }}
uses: rectalogic/notify-irc@v1
with:
channel: "#gentoo-guru"
server: "irc.libera.chat"
nickname: "github-ci"
message: CI failure detected on job ${{ github.workflow }} - ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
- name: Inform recovery on IRC
if: ${{ success() && env.last_status != 'success' && fromJSON(env.irc_notify) }}
uses: rectalogic/notify-irc@v1
with:
channel: "#gentoo-guru"
server: "irc.libera.chat"
nickname: "github-ci"
message: CI on job ${{ github.workflow }} is green again. Thanks!