Skip to content

Commit 758b2e3

Browse files
authored
Merge pull request #441 from RyanGlScott/gha-irc-notifications
GHA: Use always() to ensure IRC job is always run
2 parents 8629a90 + 08bc7bd commit 758b2e3

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

.github/workflows/haskell-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
runs-on: ubuntu-18.04
2525
needs:
2626
- linux
27-
if: ${{ github.repository == 'haskell-CI/haskell-ci' }}
27+
if: ${{ always() && (github.repository == 'haskell-CI/haskell-ci') }}
2828
strategy:
2929
fail-fast: false
3030
steps:

fixtures/irc-channels.github

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
runs-on: ubuntu-18.04
2323
needs:
2424
- linux
25+
if: ${{ always() }}
2526
strategy:
2627
fail-fast: false
2728
steps:

src/HaskellCI/GitHub.hs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ makeGitHub _argv config@Config {..} gitconfig prj jobs@JobVersions {..} = do
403403
, ghjRunsOn = "ubuntu-18.04" -- TODO: use cfgUbuntu
404404
, ghjNeeds = []
405405
, ghjSteps = steps
406-
, ghjIf = Nothing -- TODO: Use cfgIrcIfInOriginRepo
406+
, ghjIf = Nothing
407407
, ghjContainer = Just "buildpack-deps:bionic" -- use cfgUbuntu?
408408
, ghjContinueOnError = Just "${{ matrix.allow-failure }}"
409409
, ghjMatrix =
@@ -516,10 +516,12 @@ ircJob mainJobName projectName cfg gitconfig = item ("irc", GitHubJob
516516
, Just repo <- parseGitHubRepo url
517517

518518
= Just
519-
$ "${{ github.repository == '" ++ T.unpack repo ++ "' }}"
519+
$ "${{ always() && (github.repository == '" ++ T.unpack repo ++ "') }}"
520520

521521
| otherwise
522-
= Nothing
522+
= Just "${{ always() }}"
523+
-- Use always() above to ensure that the IRC job will still run even if
524+
-- the build job itself fails (see #437).
523525

524526
ircStep :: String -> Bool -> GitHubStep
525527
ircStep serverChannelName success =

0 commit comments

Comments
 (0)