forked from sourcegraph/sourcegraph-public-snapshot
-
Notifications
You must be signed in to change notification settings - Fork 2
34 lines (28 loc) · 1.16 KB
/
iteration-stats-slackbot.yml
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
name: Code Insights iteration stats Slack bot
on:
schedule:
# Every Friday 5pm PST (Saturday 1am UTC)
- cron: 0 1 * * 6
jobs:
update-status:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Post iteration stats
uses: Amadevus/pwsh-script@v2
env:
GITHUB_TOKEN: ${{ secrets.GH_PROJECTS_ACTION_TOKEN }}
SLACK_WEBHOOK_URI: ${{ secrets.INSIGHTS_ITERATION_SLACKBOT_WEBHOOK_URI }}
with:
script: |
$InformationPreference = 'Continue'
$ProgressPreference = 'SilentlyContinue'
$ErrorActionPreference = 'Stop'
Set-StrictMode -Version 3.0
Install-Module PSGitHub -Force
Install-Module PSSlack -Force
if (!$env:GITHUB_TOKEN) {
throw "No GITHUB_TOKEN env var provided"
}
$PSDefaultParameterValues['*GitHub*:Token'] = ConvertTo-SecureString -String $env:GITHUB_TOKEN -AsPlainText -Force
./.github/workflows/post-iteration-stats.ps1 -ProjectNodeId 'MDExOlByb2plY3ROZXh0MzI3Ng==' -SlackChannel '#code-insights-planning' -SlackWebhookUri $env:SLACK_WEBHOOK_URI