Important
This has only been tested with ConcourseCI 7.11.2 and may not work with older versions.
Note
docker.io
is the default public registry, https://hub.docker.com.
resource_types:
- name: discord-webhook-resource
type: registry-image
source:
repository: docker.io/favware/concourse-discord-webhook-resource
tag: latest
check_every: 24h
Alternatively pull the image from the GitHub registry
resource_types:
- name: discord-webhook-resource
type: registry-image
source:
repository: ghcr.io/favware/concourse-discord-webhook-resource
tag: latest
check_every: 24h
Note
The tag: latest
source property is optional, as the value latest
in the
default.
To setup an incoming webhook, create it in Discord on the desired channel, then configure the URL in the resource configuration.
-
url
(required) (string): The webhook URL as provided by Discord. Always in the format:https://discord.com/api/webhooks/XXXX/ZZZZ
whereinXXXX
is the webhook ID andZZZZ
is the webhook token. -
insecure
: Optional. Connect to Discord insecurely - i.e. skip SSL validation. Defaults tofalse
if not provided. -
proxy
: Optional. Connect to Discord using an HTTP(S) proxy. In the form:http://my.proxy:3128
. -
disable
: Optional. Set totrue
to skip all messaging. Convenient for temporarily disabling notifications without editing your pipelines.
resources:
- name: discord-notification
type: discord-webhook-resource
icon: chat
check_every: 24h
source:
url: https://discord.com/api/webhooks/XXXX/ZZZZ
Checking for new version always returns the last timestamp-based dummy version,
created when the last put
step was executed on this resource.
Getting a new version of this resource does nothing else that always returning
the last timestamp-based dummy version, created when the last put
step was
executed on this resource.
Send message using a Discord webhook with the configured parameters. Parameters
can be passed in using the
params key on
the put
step or passed in via files.
The parameters mimic the bulk of the parameters from https://discord.com/developers/docs/resources/webhook#execute-webhook.
content
(required) (string): The message contents (up to 2000 characters). For formatting your content see Markdown Text 101.
Note
You can add the following parameters in your content that will be replaced with their respective ConcourseCI values:
ATC_EXTERNAL_URL
- The external URL to your ConcourseCI instanceBUILD_ID
- The ID of the buildBUILD_JOB_ID
- The ID of the jobBUILD_JOB_NAME
- The name of the jobBUILD_NAME
- The name of the buildBUILD_PIPELINE_ID
- The ID of the pipelineBUILD_PIPELINE_NAME
- The name of the pipelineBUILD_TEAM_ID
- The ID of the teamBUILD_TEAM_NAME
- The name of the team To insert these values, use the following syntax:${BUILD_ID}
or$BUILD_ID
username
(string): Override the default username of the webhookavatar_url
(string): Any text wanted to ultimately appear on the page as the title of the message.allowed_mentions
(object): Allowed mentions for the message..roles
(array of strings): Roles that are allowed to be mentioned (default:[]
)..users
(array of strings): Users that are allowed to be mentioned (default:[]
).
Important
Make sure to wrap these values in quotes to prevent YAML from interpreting them as numbers and performing invalid rounding operation.
flags
(object): An object of the allowed values from message flags.suppress_embeds
(boolean): Do not include any embeds when serializing this message (default:false
)..suppress_notifications
(boolean): This message will not trigger push and desktop notifications (default:false
).
verbose
(boolean): Whether to print verbose messages during the process (useful for debugging) (default:false
).
jobs:
- name: discord-send
plan:
- put: discord-notification
params:
content: |
Job `${BUILD_JOB_NAME}` in `${BUILD_PIPELINE_NAME}` had a result. Check it out at:
${ATC_EXTERNAL_URL}/teams/${BUILD_TEAM_NAME}/pipelines/${BUILD_PIPELINE_NAME}/jobs/${BUILD_JOB_NAME}/builds/${BUILD_NAME}
or at:
${ATC_EXTERNAL_URL}/builds/${BUILD_ID}
With additional parameters
jobs:
- name: discord-send
plan:
- put: discord-notification
params:
content: |
Job `${BUILD_JOB_NAME}` in `${BUILD_PIPELINE_NAME}` had a result. Check it out at:
${ATC_EXTERNAL_URL}/teams/${BUILD_TEAM_NAME}/pipelines/${BUILD_PIPELINE_NAME}/jobs/${BUILD_JOB_NAME}/builds/${BUILD_NAME}
or at:
${ATC_EXTERNAL_URL}/builds/${BUILD_ID}
username: ConcourseCI
avatar_url: https://github.com/cloudfoundry-community.png
allowed_mentions:
roles:
- '123456789012345678'
- '234567890123456789'
users:
- '345678901234567890'
- '456789012345678901'
flags:
suppress_notifications: true
Favware projects are and always will be open source, even if we don't get donations. That being said, we know there are amazing people who may still want to donate just to show their appreciation. Thank you very much in advance!
We accept donations through Ko-fi, Paypal, Patreon, GitHub Sponsorships, and various cryptocurrencies. You can use the buttons below to donate through your method of choice.
Donate With | Address |
---|---|
Ko-fi | Click Here |
Patreon | Click Here |
PayPal | Click Here |
GitHub Sponsors | Click Here |
Bitcoin | 1E643TNif2MTh75rugepmXuq35Tck4TnE5 |
Ethereum | 0xF653F666903cd8739030D2721bF01095896F5D6E |
LiteCoin | LZHvBkaJqKJRa8N7Dyu41Jd1PDBAofCik6 |
Please make sure to read the Contributing Guide before making a pull request.
Thank you to all the people who already contributed to Sapphire!