-
Notifications
You must be signed in to change notification settings - Fork 14
47 lines (45 loc) · 1.58 KB
/
example-bashbot-github-action.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
39
40
41
42
43
44
45
46
47
# Name: example-bashbot-github-action.yaml
# Author: Mathew Fleisch <[email protected]>
# Description: This action demonstrates how to trigger a GitHub action from Bashbot.
name: Example Bashbot Triggered GitHub Action
on:
repository_dispatch:
types:
- trigger-github-action
jobs:
build:
name: Example Bashbot Triggered GitHub Action
runs-on: ubuntu-latest
steps:
-
name: Install stuff with asdf
uses: asdf-vm/actions/install@v2
with:
tool_versions: |
bashbot 2.0.5
yq 4.30.6
-
name: Send Slack Message With Bashbot Binary
env:
BASHBOT_CONFIG_FILEPATH: ./config.yaml
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
SLACK_APP_TOKEN: ${{ secrets.SLACK_APP_TOKEN }}
SLACK_CHANNEL: ${{ github.event.client_payload.channel }}
SLACK_USERID: ${{ github.event.client_payload.user_id }}
GIT_TOKEN: ${{ github.token }}
run: |
cat <<EOF > $BASHBOT_CONFIG_FILEPATH
admins:
- trigger: bashbotexample
appName: Bashbot Example
userIds:
- "UP3BBQX34"
privateChannelId: "GPFMM5MD2"
logChannelId: "CPJ1NFPL7"
messages: []
tools: []
dependencies: []
EOF
bashbot send-message \
--channel ${SLACK_CHANNEL} \
--msg "<@${SLACK_USERID}> Bashbot triggered this job: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"