CI: Notify channel on drone yaml changes (#42428)
* Notify on drone yaml changes * Change secrets * Remove test notification * Fix typo
This commit is contained in:
@@ -6,6 +6,9 @@ load(
|
||||
|
||||
load('scripts/drone/vault.star', 'from_secret', 'github_token', 'pull_secret', 'drone_token')
|
||||
|
||||
failure_template = 'Build {{build.number}} failed for commit: <https://github.com/{{repo.owner}}/{{repo.name}}/commit/{{build.commit}}|{{ truncate build.commit 8 }}>: {{build.link}}\nBranch: <https://github.com/{{ repo.owner }}/{{ repo.name }}/commits/{{ build.branch }}|{{ build.branch }}>\nAuthor: {{build.author}}'
|
||||
drone_change_template = '`.drone.yml` and `starlark` files have been changed on the OSS repo, by: {{build.author}}. \nBranch: <https://github.com/{{ repo.owner }}/{{ repo.name }}/commits/{{ build.branch }}|{{ build.branch }}>\nCommit hash: <https://github.com/{{repo.owner}}/{{repo.name}}/commit/{{build.commit}}|{{ truncate build.commit 8 }}>'
|
||||
|
||||
def pipeline(
|
||||
name, edition, trigger, steps, services=[], platform='linux', depends_on=[],
|
||||
):
|
||||
@@ -54,8 +57,8 @@ def pipeline(
|
||||
|
||||
return pipeline
|
||||
|
||||
def notify_pipeline(name, slack_channel, trigger, depends_on=[]):
|
||||
trigger = dict(trigger, status = ['failure'])
|
||||
def notify_pipeline(name, slack_channel, trigger, depends_on=[], template=None, secret=None):
|
||||
trigger = dict(trigger)
|
||||
return {
|
||||
'kind': 'pipeline',
|
||||
'type': 'docker',
|
||||
@@ -66,7 +69,7 @@ def notify_pipeline(name, slack_channel, trigger, depends_on=[]):
|
||||
'name': name,
|
||||
'trigger': trigger,
|
||||
'steps': [
|
||||
slack_step(slack_channel),
|
||||
slack_step(slack_channel, template, secret),
|
||||
],
|
||||
'depends_on': depends_on,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user