-
Notifications
You must be signed in to change notification settings - Fork 223
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0055b88
commit d610a77
Showing
1 changed file
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: dogfood merge | ||
# This workflow is triggered on pushes to master and dogfood branches | ||
on: | ||
push: | ||
delete: | ||
# There is no 'branch:' filter for the delete action, | ||
# so we are using 'if:' inside the job instead. | ||
|
||
env: | ||
SLACK_CHANNEL: team-lang-dotnet | ||
SLACK_USERNAME: Dogfood build action | ||
|
||
jobs: | ||
dogfood_merge: | ||
if: >- | ||
(github.event_name == 'push' && (github.event.ref == 'refs/heads/master' || startsWith(github.event.ref, 'refs/heads/dogfood/'))) | ||
|| (github.event_name == 'delete' && startsWith(github.event.ref, 'dogfood/')) | ||
runs-on: ubuntu-latest | ||
name: Update dogfood branch | ||
permissions: | ||
id-token: write # required for SonarSource/vault-action-wrapper | ||
steps: | ||
- name: get secrets | ||
id: secrets | ||
uses: SonarSource/vault-action-wrapper@v2 | ||
with: | ||
secrets: | | ||
development/kv/data/slack webhook | SLACK_WEBHOOK; | ||
- name: git octopus step | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_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/action-slack@1.6.2 | ||
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/action-slack@1.6.2 | ||
if: failure() | ||
with: | ||
args: "Dogfood merge failed by {{ GITHUB_ACTOR }}, see {{ GITHUB_SERVER_URL }}/{{ GITHUB_REPOSITORY }}/actions/runs/{{ GITHUB_RUN_ID }}" |