-
Notifications
You must be signed in to change notification settings - Fork 41
67 lines (58 loc) · 1.7 KB
/
EVENT_merge_to_master.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
57
58
59
60
61
62
63
64
65
66
67
name: merge_to_master
run-name: Merge to master
on:
push:
branches:
- master
workflow_call:
permissions:
contents: read
id-token: write # Necessary for the generate documentation job
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
run_tests:
name: Run tests
uses: ./.github/workflows/JOB_tests.yml
documentation:
name: Documentation
uses: ./.github/workflows/JOB_generate_documentation.yml
secrets: inherit
permissions:
id-token: write
contents: read
warn_on_fail:
needs: [run_tests, documentation]
if: ${{ failure() }}
name: Slack message us on fail
uses: ./.github/workflows/JOB_slack_message.yml
secrets: inherit
with:
at_team: true
icon: ':warning:'
message: 'Master is failing after a push event, please review at ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }}'
success:
needs: [run_tests, documentation]
if: ${{ success() }}
name: Success
runs-on: ubuntu-latest
permissions:
contents: write
statuses: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- name: Set branch status to success
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
await github.rest.repos.createCommitStatus({
owner: context.repo.owner,
repo: context.repo.repo,
sha: context.sha,
state: 'success'
})