generated from ministryofjustice/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 12
38 lines (36 loc) · 1.26 KB
/
outside-collaborators-check.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: Outside collaborators check and remove manually added collaborators
on:
workflow_dispatch:
schedule:
- cron: "0 7 * * *"
env:
RUBY_VERSION: 3.1.0
jobs:
outside-collaborators-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.RUBY_VERSION }}
bundler-cache: true
- name: Check the outside collaborators
run: bin/outside-collaborators.rb
env:
OPS_BOT_TOKEN: ${{ secrets.MOJ_COLLABORATORS_GENERAL_ADMIN_BOT_PAT }}
NOTIFY_PROD_TOKEN: ${{ secrets.NOTIFY_PROD_TOKEN }}
NOTIFY_TEST_TOKEN: ${{ secrets.NOTIFY_TEST_TOKEN }}
REALLY_POST_TO_SLACK: ${{ secrets.POST_TO_SLACK }}
REALLY_POST_TO_GH: ${{ secrets.POST_TO_GH }}
REALLY_SEND_TO_NOTIFY: ${{ secrets.SEND_TO_NOTIFY }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
LOG_LEVEL: "debug"
- name: Report failure to Slack
if: always()
uses: ravsamhq/notify-slack-action@v2
with:
status: ${{ job.status }}
notify_when: "failure"
notification_title: "Failed GitHub Action Run"
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}