-
Notifications
You must be signed in to change notification settings - Fork 119
44 lines (41 loc) · 1.06 KB
/
main.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
name: Rust
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
merge_group:
types: [checks_requested]
schedule:
# Runs at 03:30, every Saturday
- cron: "30 3 * * 6"
# dispatches build workflow with different permissions
jobs:
elevated:
if: ${{ github.event_name == 'push' }}
permissions:
contents: write
id-token: write
attestations: write
uses: ./.github/workflows/build.yml
with:
release: true
secrets: inherit
normal:
if: ${{ github.event_name != 'push' }}
uses: ./.github/workflows/build.yml
with:
release: false
secrets: inherit
build_result:
name: Result
runs-on: ubuntu-latest
needs: ["elevated", "normal"]
if: ${{ always() }}
steps:
- name: Mark the job as successful
if: ${{ !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') }}
run: exit 0
- name: Mark the job as unsuccessful
if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
run: exit 1