diff --git a/.github/workflows/afternoon_seal.yml b/.github/workflows/afternoon_seal.yml index 05c32bee..943b2763 100644 --- a/.github/workflows/afternoon_seal.yml +++ b/.github/workflows/afternoon_seal.yml @@ -1,6 +1,13 @@ name: "Afternoon Seal" -on: workflow_dispatch +on: + workflow_dispatch: {} + schedule: + - cron: '00 12 * * 1-5' # Runs at 12:00, Monday through Friday. + +env: + SEAL_ORGANISATION: alphagov + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} jobs: afternoon-seal: @@ -18,6 +25,8 @@ jobs: id: afternoon_seal run: | teams=( + govuk-accounts + govuk-platform-security-reliability ) for team in ${teams[*]} ; do diff --git a/.github/workflows/dependapanda.yml b/.github/workflows/dependapanda.yml index d4d16313..eca2486a 100644 --- a/.github/workflows/dependapanda.yml +++ b/.github/workflows/dependapanda.yml @@ -1,6 +1,14 @@ name: "Dependapanda" -on: workflow_dispatch +on: + workflow_dispatch: {} + schedule: + - cron: '00 8 * * 1-5' # Runs at 8:00, Monday through Friday. + +env: + SEAL_ORGANISATION: alphagov + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} jobs: dependapanda: @@ -16,13 +24,26 @@ jobs: - name: Dependapanda id: dependapanda - env: - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} run: | - teams=( - ) - - for team in ${teams[*]}; do - ./bin/seal_runner.rb $team dependapanda - sleep 60 - done + teams=( + di-ipv-orange-cri-maintainers + govuk-accounts-tech + govuk-datagovuk + govuk-developers + govuk-forms + govuk-platform-security-reliability + govuk-publishing-access-and-permissions + govuk-publishing-components + govuk-publishing-experience + govuk-publishing-on-platform-content + govuk-publishing-platform + govuk-platform-engineering + content-interactions-on-platform-govuk + navigation-and-homepage-govuk + user-experience-measurement-govuk + ) + + for team in ${teams[*]}; do + ./bin/seal_runner.rb $team dependapanda + sleep 60 + done diff --git a/.github/workflows/morning_seal.yml b/.github/workflows/morning_seal.yml index f7aca1e4..b0b83f12 100644 --- a/.github/workflows/morning_seal.yml +++ b/.github/workflows/morning_seal.yml @@ -1,6 +1,14 @@ name: "Morning Seal" -on: workflow_dispatch +on: + workflow_dispatch: {} + schedule: + - cron: '30 7 * * 1-5' # Runs at 7:30, Monday through Friday. + +env: + SEAL_ORGANISATION: alphagov + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} jobs: morning-seal: @@ -16,19 +24,41 @@ jobs: - name: Morning Seal id: morning_seal - env: - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} run: | - teams=( - ) - - for team in ${teams[*]}; do - ./bin/seal_runner.rb $team - done - - morning_quote_teams=( - ) - - for team in ${morning_quote_teams[*]}; do - ./bin/seal_runner.rb $team quotes - done + teams=( + di-ipv-orange-cri-maintainers + govuk-accounts-tech + govuk-datagovuk + govuk-developers + govuk-forms + govuk-pay + govuk-platform-security-reliability + govuk-publishing-access-and-permissions + govuk-publishing-components + govuk-publishing-experience + govuk-publishing-on-platform-content + govuk-publishing-platform + govuk-platform-engineering + govwifi + content-interactions-on-platform-govuk + navigation-and-homepage-govuk + user-experience-measurement-govuk + dev-platform-team + ) + + for team in ${teams[*]}; do + ./bin/seal_runner.rb $team + done + + morning_quote_teams=( + fun-workstream-govuk + fun-workstream-gds-community + govuk-green-team + navigation-and-homepage-govuk + dev-platform-team + user-experience-measurement-govuk + ) + + for team in ${morning_quote_teams[*]}; do + ./bin/seal_runner.rb $team quotes + done diff --git a/Procfile b/Procfile deleted file mode 100644 index 8c995585..00000000 --- a/Procfile +++ /dev/null @@ -1 +0,0 @@ -web: bundle exec rackup config.ru -p $PORT diff --git a/app.json b/app.json deleted file mode 100644 index 0643d1b6..00000000 --- a/app.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "name": "Seal: A Slack Github PR Bot", - "description": "A bot that notifies Slack about open GitHub PRs.", - "keywords": [ - "slack", - "github" - ], - "repository": "https://github.com/binaryberry/seal", - "env": { - "SEAL_ORGANISATION": { - "description": "Your Github organisation name" - }, - "GITHUB_TOKEN": { - "description": "Your Github token (obtainable at https://github.com/settings/tokens)" - }, - "GITHUB_API_ENDPOINT": { - "description": "OPTIONAL. If you are using a Github Enterprise instance instead of public github.com i.e https://github.yourcompany.com/api/v3" - }, - "GITHUB_QUOTES_DAYS": { - "description": "What days of the week should the Seal post quotes", - "required": true - }, - "GITHUB_USE_LABELS": { - "description": "Comma separated list of labels to include", - "required": false - }, - "GITHUB_SECURITY_ALERTS": { - "description": "Should Dependapanda include security alerts information along with the standard Dependapanda info", - "required": false - }, - "GITHUB_EXCLUDE_LABELS": { - "description": "Comma separated list of labels to exclude", - "required": false - }, - "GITHUB_EXCLUDE_TITLES": { - "description": "Comma separated list of titles e.g (WIP) to exclude", - "required": false - }, - "QUOTES": { - "description": "Comma separated list of sentences you would like the Seal to post. Can be used for inspirational quotes or reminders.", - "required": false - }, - "SLACK_WEBHOOK": { - "description": "Your Slack Incoming Webhook token (obtainable at https://slack.com/services/new/incoming-webhook)" - }, - "SLACK_CHANNEL": { - "description": "Slack channel to notify", - "required": false - }, - "TZ": { - "description": "The timezone within which Seal operates (e.g. Australia/Melbourne)", - "required": false - } - }, - "addons": [ - "scheduler" - ] -} diff --git a/bin/afternoon_seal.sh b/bin/afternoon_seal.sh deleted file mode 100755 index a41674bc..00000000 --- a/bin/afternoon_seal.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -teams=( - govuk-accounts - govuk-platform-security-reliability -) - -for team in ${teams[*]} ; do - ./bin/seal_runner.rb $team quotes -done diff --git a/bin/dependapanda.sh b/bin/dependapanda.sh deleted file mode 100644 index 913fde46..00000000 --- a/bin/dependapanda.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -teams=( - di-ipv-orange-cri-maintainers - govuk-accounts-tech - govuk-datagovuk - govuk-developers - govuk-forms - govuk-platform-security-reliability - govuk-publishing-access-and-permissions - govuk-publishing-components - govuk-publishing-experience - govuk-publishing-on-platform-content - govuk-publishing-platform - govuk-platform-engineering - content-interactions-on-platform-govuk - navigation-and-homepage-govuk - user-experience-measurement-govuk -) - -for team in ${teams[*]}; do - ./bin/seal_runner.rb $team dependapanda - sleep 60 -done diff --git a/bin/morning_seal.sh b/bin/morning_seal.sh deleted file mode 100755 index a86b8378..00000000 --- a/bin/morning_seal.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash - -teams=( - di-ipv-orange-cri-maintainers - govuk-accounts-tech - govuk-datagovuk - govuk-developers - govuk-forms - govuk-pay - govuk-platform-security-reliability - govuk-publishing-access-and-permissions - govuk-publishing-components - govuk-publishing-experience - govuk-publishing-on-platform-content - govuk-publishing-platform - govuk-platform-engineering - govwifi - content-interactions-on-platform-govuk - navigation-and-homepage-govuk - user-experience-measurement-govuk - dev-platform-team -) - -for team in ${teams[*]}; do - ./bin/seal_runner.rb $team -done - -morning_quote_teams=( - fun-workstream-govuk - fun-workstream-gds-community - govuk-green-team - navigation-and-homepage-govuk - dev-platform-team - user-experience-measurement-govuk -) - -for team in ${morning_quote_teams[*]}; do - ./bin/seal_runner.rb $team quotes -done diff --git a/config.ru b/config.ru deleted file mode 100644 index 3efc97ae..00000000 --- a/config.ru +++ /dev/null @@ -1,4 +0,0 @@ -# frozen_string_literal: true - -require './server' -run SealApp diff --git a/lib/slack_poster.rb b/lib/slack_poster.rb index a62200ae..66dd2567 100644 --- a/lib/slack_poster.rb +++ b/lib/slack_poster.rb @@ -100,6 +100,6 @@ def set_mood_from_team end def channel - @team_channel = "#bot-testing" if ENV["DYNO"].nil? + @team_channel = "#bot-testing" if ENV["DEVELOPMENT"] end end diff --git a/server.rb b/server.rb deleted file mode 100644 index 6768bbf6..00000000 --- a/server.rb +++ /dev/null @@ -1,28 +0,0 @@ -require "sinatra" -require "./lib/seal" -require "./lib/github_fetcher" -require "./lib/message_builder" -require "./lib/slack_poster" -require "./lib/team_builder" - -class SealApp < Sinatra::Base - get "/" do - "Hello Seal" - end - - post "/bark/:team_name/:secret" do - if params[:secret] == ENV["SEAL_SECRET"] - team = TeamBuilder.build(env: ENV, team_name: params[:team_name]) - Seal.new(team).bark - "Seal received message with #{params[:team_name]} team name" - end - end - - post "/bark-quotes/:team_name/:secret" do - if params[:secret] == ENV["SEAL_SECRET"] - team = TeamBuilder.build(env: ENV, team_name: params[:team_name]) - Seal.new(team).bark(mode: "quotes") - "Seal received message with #{params[:team_name]} team name for quotes" - end - end -end