From 649ee6d81f652f907f4bd5b0649775720b352b6d Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Sat, 1 Mar 2025 14:37:52 +0300 Subject: CI: the IRC posting is now in a separate workflow and runs only after successful ci.yml runs * people are not spammed with commits, that may cause problems when they try to pull them and rebuild --- .github/workflows/ci.yml | 17 ----------------- .github/workflows/irc.yml | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 17 deletions(-) create mode 100644 .github/workflows/irc.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4db29d2..d42585a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,23 +3,6 @@ name: Continuous Integration on: [push, pull_request] jobs: - # Only for posting into the IRC channel. - # FIXME: Perhaps we should do this only after all of CI is successful and - # include all commits since the last successful CI run? - irc: - runs-on: ubuntu-latest - steps: - - name: Git Clone - uses: actions/checkout@v4.1.6 - - name: Post into IRC channel - if: ${{ github.event_name == 'push' }} - run: | - (echo "NICK git-bot" - echo "USER git-bot 8 * : git-bot" - echo "JOIN #sciteco" - git log --pretty="format:PRIVMSG #sciteco %h %s" --reverse ${{ github.event.before }}..${{ github.event.after }} - echo "QUIT") | ncat --ssl irc.libera.chat 6697 - ubuntu: strategy: matrix: diff --git a/.github/workflows/irc.yml b/.github/workflows/irc.yml new file mode 100644 index 0000000..a44774c --- /dev/null +++ b/.github/workflows/irc.yml @@ -0,0 +1,33 @@ +# After every push with successful CI, +# post the commits since the last successful CI into the IRC channel. +name: IRC Post + +on: + workflow_run: + workflows: ['Continuous Integration'] + types: [completed] + branches: master + +jobs: + irc: + runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'success' }} + steps: + - name: Git Clone + uses: actions/checkout@v4.1.6 + - name: Install Build Dependencies + run: sudo apt-get install -y ncat + - name: Get last successful commit + uses: nrwl/last-successful-commit-action@v1 + id: last_successful_commit + with: + branch: 'master' + workflow_id: 'ci.yml' + github_token: ${{ secrets.GITHUB_TOKEN }} + - name: IRC Connection + run: | + (echo "NICK git-bot" + echo "USER git-bot 8 * : git-bot" + echo "JOIN #sciteco" + git log --pretty="format:PRIVMSG #sciteco %h %s" --reverse ${{ steps.last_successful_commit.outputs.commit_hash }}..HEAD + echo "QUIT") | ncat --ssl irc.libera.chat 6697 -- cgit v1.2.3