|
1 | 1 | name: 'CI' |
2 | | -on: pull_request |
| 2 | +on: |
| 3 | + pull_request_target: |
| 4 | + types: |
| 5 | + - opened |
| 6 | + - synchronize |
| 7 | + - labeled |
| 8 | + - reopened |
| 9 | + |
| 10 | +permissions: |
| 11 | + contents: read |
| 12 | + pull-requests: read |
3 | 13 |
|
4 | 14 | env: |
5 | 15 | RUST_BACKTRACE: 1 |
6 | 16 | CARGO_TERM_COLOR: always |
7 | 17 |
|
8 | 18 | jobs: |
| 19 | + check-user-trust: |
| 20 | + runs-on: ubuntu-latest |
| 21 | + outputs: |
| 22 | + is-trusted: ${{ steps.check.outputs.is_trusted }} |
| 23 | + steps: |
| 24 | + - name: Check if PR sender is trusted |
| 25 | + id: check |
| 26 | + run: | |
| 27 | + ASSOC="${{ github.event.sender.author_association }}" |
| 28 | + echo "Sender association: $ASSOC" |
| 29 | + if [[ "$ASSOC" == "OWNER" || "$ASSOC" == "MEMBER" || "$ASSOC" == "COLLABORATOR" ]]; then |
| 30 | + echo "trusted=true" >> $GITHUB_OUTPUT |
| 31 | + else |
| 32 | + echo "trusted=false" >> $GITHUB_OUTPUT |
| 33 | + fi |
| 34 | + |
9 | 35 | test-stable-hosted: |
10 | 36 | strategy: |
11 | 37 | fail-fast: false |
|
14 | 40 | - [self-hosted, Linux, amd64] |
15 | 41 | - [self-hosted, Linux, aarch64] |
16 | 42 | name: Rust stable |
| 43 | + needs: check-user-trust |
| 44 | + if: needs.check-user-trust.outputs.is_trusted == 'true' |
17 | 45 | runs-on: ${{matrix.os}} |
18 | 46 | timeout-minutes: 45 |
19 | 47 | steps: |
|
22 | 50 | - run: ./scripts/test.sh |
23 | 51 |
|
24 | 52 | test-stable-wasm: |
| 53 | + needs: check-user-trust |
| 54 | + if: needs.check-user-trust.outputs.is_trusted == 'true' |
25 | 55 | runs-on: [self-hosted, Linux, amd64] |
26 | 56 | env: |
27 | 57 | WASMTIME_BACKTRACE_DETAILS: 1 |
|
42 | 72 |
|
43 | 73 |
|
44 | 74 | test-nightly-hosted: |
| 75 | + needs: check-user-trust |
| 76 | + if: needs.check-user-trust.outputs.is_trusted == 'true' |
45 | 77 | strategy: |
46 | 78 | fail-fast: false |
47 | 79 | matrix: |
|
57 | 89 | - run: ./scripts/test.sh |
58 | 90 |
|
59 | 91 | clippy_lint: |
| 92 | + needs: check-user-trust |
| 93 | + if: needs.check-user-trust.outputs.is_trusted == 'true' |
60 | 94 | name: Format check |
61 | 95 | runs-on: [self-hosted, Linux, amd64] |
62 | 96 | timeout-minutes: 45 |
|
71 | 105 | cargo fmt -- --check |
72 | 106 |
|
73 | 107 | sanitize: |
| 108 | + needs: check-user-trust |
| 109 | + if: needs.check-user-trust.outputs.is_trusted == 'true' |
74 | 110 | strategy: |
75 | 111 | fail-fast: false |
76 | 112 | matrix: |
|
90 | 126 | run: ./scripts/sanitize.sh ${{matrix.san}} ${{matrix.feature}} |
91 | 127 |
|
92 | 128 | fuzz: |
| 129 | + needs: check-user-trust |
| 130 | + if: needs.check-user-trust.outputs.is_trusted == 'true' |
93 | 131 | runs-on: [self-hosted, Linux, amd64] |
94 | 132 | steps: |
95 | 133 | - uses: actions/checkout@v4 |
|
0 commit comments