These are some example Ghi file configurations.
Location:
- Current Directory (
./.ghi.yml
) - Home Directory (
~/.ghi.yml
) - Tmp Directory (
/tmp/.ghi.yml
) - Specified (
GHI_CONFIG_FILE="~/configs/.ghi.yml"
)
Content:
Send events from a single repository to multiple channels with no payload verification with debug enabled:
version: 1
debug: true
pools:
- name: my-pool
github:
repos:
- name: gkrizek/repo1
verify: false
branches:
- master
- staging
irc:
host: chat.freenode.net
nick: my-irc-bot
password: myBotPassword123!
channels:
- channel1
- "#channel2"
This only sends messages for push
events for the master
and staging
branches.
Send events from multiple repositories to multiple channels using payload verificiaton:
version: 1
pools:
- name: my-pool
github:
repos:
- name: gkrizek/repo1
secret: 2ace6481252d0187fd33e49449766b6a64c7d6f8e
- name: gkrizek/repo2
secret: 33e4946b6a64c7d6f8e2ad0252d0187fd33e49449
irc:
host: chat.freenode.net
nick: my-irc-bot
password: myBotPassword123!
channels:
- channel1
- "#channel2"
In this configuration, a push to repo1
or repo2
will send messages to both channels #channel1
and #channel2
Globally configure IRC server and send messages to different channels for different repos with shortened urls:
version: 1
global:
github:
shorten_url: true
irc:
host: chat.freenode.net
nick: my-irc-bot
password: myBotPassword123!
ssl: false
pools:
- name: my-pool1
github:
repos:
- name: gkrizek/repo1
secret: 2ace6481252d0187fd33e49449766b6a64c7d6f8e
irc:
channels:
- channel1
- name: my-pool2
github:
repos:
- name: gkrizek/repo2
secret: 33e4946b6a64c7d6f8e2ad0252d0187fd33e49449
irc:
channels:
- channel2
In this configuration, a push to repo1
will only send to channel
and repo2
will only send to #channel2
Set secrets as environment variables:
version: 1
pools:
- name: my-pool
github:
repos:
- name: gkrizek/repo1
irc:
host: chat.freenode.net
nick: my-irc-bot
channels:
- channel1
- "#channel2"
Environment Variables:
GHI_GITHUB_SECRET_GKRIZEK_REPO1="2ace6481252d0187fd33e49449766b6a64c7d6f8e"
GHI_IRC_PASSWORD_MYPOOL="myBotPassword123!"