Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
MuriloDalRi committed Oct 2, 2023
1 parent 5aaf193 commit a666c11
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 8 deletions.
38 changes: 32 additions & 6 deletions .github/workflows/afternoon_seal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,35 @@ jobs:
- name: Afternoon Seal
id: afternoon_seal
run: |
teams=(
)
for team in ${teams[*]} ; do
./bin/seal_runner.rb $team quotes
done
output=$(./bin/seal_runner.rb govuk-platform-security-reliability quotes)
echo "$output"
- name: Notify failure
uses: slackapi/slack-github-action@v1
with:
payload: |
{
"text": "govuk-user-reviewer has detected ${{ steps.afternoon_seal.outputs.output }} access problems that need fixing. View the build logs for details.",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "govuk-user-reviewer has detected ${{ steps.afternoon_seal.outputs.output }} access problems that need fixing. View the build logs for details."
},
"accessory": {
"type": "button",
"text": {
"type": "plain_text",
"text": "View"
},
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}",
"action_id": "button-view-workflow"
}
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
2 changes: 1 addition & 1 deletion lib/seal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def bark_at(team, mode: nil)
return if message.nil?

poster = SlackPoster.new(team.channel, message.mood)
poster.send_request(message.text)
poster
rescue StandardError => e
puts "Error barking at team '#{team.name}': #{e.message}"
end
Expand Down
2 changes: 1 addition & 1 deletion lib/slack_poster.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,6 @@ def set_mood_from_team
end

def channel
@team_channel = "#bot-testing" if ENV["DYNO"].nil?
@team_channel = "#murilo-testing"
end
end

0 comments on commit a666c11

Please sign in to comment.