-
Notifications
You must be signed in to change notification settings - Fork 688
56 lines (54 loc) · 2.02 KB
/
dogfood.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: dogfood merge
# This workflow is triggered on pushes to master and dogfood branches
on:
push:
branches:
- master
- 'dogfood/*'
# commenting 'delete' action, as it is triggered way too often
# delete:
# branches:
# - 'dogfood/*'
env:
SLACK_CHANNEL: team-lang-java-notifs
SLACK_USERNAME: Dogfood build action
jobs:
dogfood_merge:
runs-on: ubuntu-latest
name: Update dogfood branch
permissions:
id-token: write # required for SonarSource/vault-action-wrapper
contents: write # required to grant GITHUB_TOKEN writing permission
steps:
- name: get secrets
id: secrets
uses: SonarSource/vault-action-wrapper@d1c1ab4ca5ad07fd9cdfe1eff038a39673dfca64 # tag=2.4.2-1
with:
secrets: |
development/kv/data/slack webhook | SLACK_WEBHOOK;
- name: git octopus step
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
id: dogfood
uses: SonarSource/gh-action_dogfood_merge@v1
with:
dogfood-branch: 'dogfood-on-peach'
# Use the output from the `dogfood` step
- name: Get the name of the dogfood branch and its HEAD SHA1
run: echo "The dogfood branch was `${{ steps.dogfood.outputs.dogfood-branch }}` and its HEAD SHA1 was `${{ steps.dogfood.outputs.sha1 }}`"
#slack notifications
- name: Notify success on Slack
uses: Ilshidur/[email protected]
env:
SLACK_WEBHOOK: ${{ fromJSON(steps.secrets.outputs.vault).SLACK_WEBHOOK }}
SLACK_OVERRIDE_MESSAGE: 'Dogfood build for `${{ steps.dogfood.outputs.sha1 }}`: *successful*'
with:
args: 'Succeed to build dogfood branch'
- name: Notify failures on Slack
uses: Ilshidur/[email protected]
if: failure()
env:
SLACK_WEBHOOK: ${{ fromJSON(steps.secrets.outputs.vault).SLACK_WEBHOOK }}
SLACK_OVERRIDE_MESSAGE: 'Dogfood build for `${{ steps.dogfood.outputs.sha1 }}`: *failed*, see the logs at https://github.com/SonarSource/sonar-java/actions'
with:
args: 'Fail to build dogfood branch'