fix(ci): keep unauthorized Mantis commands neutral · openclaw/openclaw@df3f983
vincentkoc
·
2026-05-17
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -33,8 +33,11 @@ jobs:
|
33 | 33 | authorize_actor: |
34 | 34 | name: Authorize workflow actor |
35 | 35 | runs-on: blacksmith-8vcpu-ubuntu-2404 |
| 36 | +outputs: |
| 37 | +authorized: ${{ steps.permission.outputs.authorized }} |
36 | 38 | steps: |
37 | 39 | - name: Require maintainer-level repository access |
| 40 | +id: permission |
38 | 41 | uses: actions/github-script@v8 |
39 | 42 | with: |
40 | 43 | script: | |
@@ -48,14 +51,18 @@ jobs:
|
48 | 51 | const permission = data.permission; |
49 | 52 | core.info(`Actor ${context.actor} permission: ${permission}`); |
50 | 53 | if (!allowed.has(permission)) { |
51 | | - core.setFailed( |
| 54 | + core.notice( |
52 | 55 | `Workflow requires write/maintain/admin access. Actor "${context.actor}" has "${permission}".`, |
53 | 56 | ); |
| 57 | + core.setOutput("authorized", "false"); |
| 58 | + return; |
54 | 59 | } |
| 60 | + core.setOutput("authorized", "true"); |
55 | 61 | |
56 | 62 | validate_selected_ref: |
57 | 63 | name: Validate selected ref |
58 | 64 | needs: authorize_actor |
| 65 | +if: needs.authorize_actor.outputs.authorized == 'true' |
59 | 66 | runs-on: blacksmith-8vcpu-ubuntu-2404 |
60 | 67 | outputs: |
61 | 68 | selected_revision: ${{ steps.validate.outputs.selected_revision }} |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -53,8 +53,11 @@ jobs:
|
53 | 53 | ) |
54 | 54 | }} |
55 | 55 | runs-on: blacksmith-8vcpu-ubuntu-2404 |
| 56 | +outputs: |
| 57 | +authorized: ${{ steps.permission.outputs.authorized }} |
56 | 58 | steps: |
57 | 59 | - name: Require maintainer-level repository access |
| 60 | +id: permission |
58 | 61 | uses: actions/github-script@v8 |
59 | 62 | with: |
60 | 63 | script: | |
@@ -68,14 +71,18 @@ jobs:
|
68 | 71 | const permission = data.permission; |
69 | 72 | core.info(`Actor ${context.actor} permission: ${permission}`); |
70 | 73 | if (!allowed.has(permission)) { |
71 | | - core.setFailed( |
| 74 | + core.notice( |
72 | 75 | `Workflow requires write/maintain/admin access. Actor "${context.actor}" has "${permission}".`, |
73 | 76 | ); |
| 77 | + core.setOutput("authorized", "false"); |
| 78 | + return; |
74 | 79 | } |
| 80 | + core.setOutput("authorized", "true"); |
75 | 81 | |
76 | 82 | resolve_request: |
77 | 83 | name: Resolve Mantis request |
78 | 84 | needs: authorize_actor |
| 85 | +if: needs.authorize_actor.outputs.authorized == 'true' |
79 | 86 | runs-on: blacksmith-8vcpu-ubuntu-2404 |
80 | 87 | outputs: |
81 | 88 | baseline_ref: ${{ steps.resolve.outputs.baseline_ref }} |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -53,8 +53,11 @@ jobs:
|
53 | 53 | ) |
54 | 54 | }} |
55 | 55 | runs-on: blacksmith-8vcpu-ubuntu-2404 |
| 56 | +outputs: |
| 57 | +authorized: ${{ steps.permission.outputs.authorized }} |
56 | 58 | steps: |
57 | 59 | - name: Require maintainer-level repository access |
| 60 | +id: permission |
58 | 61 | uses: actions/github-script@v8 |
59 | 62 | with: |
60 | 63 | script: | |
@@ -68,14 +71,18 @@ jobs:
|
68 | 71 | const permission = data.permission; |
69 | 72 | core.info(`Actor ${context.actor} permission: ${permission}`); |
70 | 73 | if (!allowed.has(permission)) { |
71 | | - core.setFailed( |
| 74 | + core.notice( |
72 | 75 | `Workflow requires write/maintain/admin access. Actor "${context.actor}" has "${permission}".`, |
73 | 76 | ); |
| 77 | + core.setOutput("authorized", "false"); |
| 78 | + return; |
74 | 79 | } |
| 80 | + core.setOutput("authorized", "true"); |
75 | 81 | |
76 | 82 | resolve_request: |
77 | 83 | name: Resolve Mantis request |
78 | 84 | needs: authorize_actor |
| 85 | +if: needs.authorize_actor.outputs.authorized == 'true' |
79 | 86 | runs-on: blacksmith-8vcpu-ubuntu-2404 |
80 | 87 | outputs: |
81 | 88 | baseline_ref: ${{ steps.resolve.outputs.baseline_ref }} |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -64,8 +64,11 @@ jobs:
|
64 | 64 | authorize_actor: |
65 | 65 | name: Authorize workflow actor |
66 | 66 | runs-on: ubuntu-24.04 |
| 67 | +outputs: |
| 68 | +authorized: ${{ steps.permission.outputs.authorized }} |
67 | 69 | steps: |
68 | 70 | - name: Require maintainer-level repository access |
| 71 | +id: permission |
69 | 72 | uses: actions/github-script@v8 |
70 | 73 | with: |
71 | 74 | script: | |
@@ -79,14 +82,18 @@ jobs:
|
79 | 82 | const permission = data.permission; |
80 | 83 | core.info(`Actor ${context.actor} permission: ${permission}`); |
81 | 84 | if (!allowed.has(permission)) { |
82 | | - core.setFailed( |
| 85 | + core.notice( |
83 | 86 | `Workflow requires write/maintain/admin access. Actor "${context.actor}" has "${permission}".`, |
84 | 87 | ); |
| 88 | + core.setOutput("authorized", "false"); |
| 89 | + return; |
85 | 90 | } |
| 91 | + core.setOutput("authorized", "true"); |
86 | 92 | |
87 | 93 | validate_ref: |
88 | 94 | name: Validate candidate ref |
89 | 95 | needs: authorize_actor |
| 96 | +if: needs.authorize_actor.outputs.authorized == 'true' |
90 | 97 | runs-on: ubuntu-24.04 |
91 | 98 | outputs: |
92 | 99 | candidate_revision: ${{ steps.validate.outputs.candidate_revision }} |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -58,8 +58,11 @@ jobs:
|
58 | 58 | ) |
59 | 59 | }} |
60 | 60 | runs-on: ubuntu-24.04 |
| 61 | +outputs: |
| 62 | +authorized: ${{ steps.permission.outputs.authorized }} |
61 | 63 | steps: |
62 | 64 | - name: Require maintainer-level repository access |
| 65 | +id: permission |
63 | 66 | uses: actions/github-script@v8 |
64 | 67 | with: |
65 | 68 | script: | |
@@ -73,14 +76,18 @@ jobs:
|
73 | 76 | const permission = data.permission; |
74 | 77 | core.info(`Actor ${context.actor} permission: ${permission}`); |
75 | 78 | if (!allowed.has(permission)) { |
76 | | - core.setFailed( |
| 79 | + core.notice( |
77 | 80 | `Workflow requires write/maintain/admin access. Actor "${context.actor}" has "${permission}".`, |
78 | 81 | ); |
| 82 | + core.setOutput("authorized", "false"); |
| 83 | + return; |
79 | 84 | } |
| 85 | + core.setOutput("authorized", "true"); |
80 | 86 | |
81 | 87 | resolve_request: |
82 | 88 | name: Resolve Mantis request |
83 | 89 | needs: authorize_actor |
| 90 | +if: needs.authorize_actor.outputs.authorized == 'true' |
84 | 91 | runs-on: ubuntu-24.04 |
85 | 92 | outputs: |
86 | 93 | baseline_ref: ${{ steps.resolve.outputs.baseline_ref }} |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -63,8 +63,11 @@ jobs:
|
63 | 63 | ) |
64 | 64 | }} |
65 | 65 | runs-on: ubuntu-24.04 |
| 66 | +outputs: |
| 67 | +authorized: ${{ steps.permission.outputs.authorized }} |
66 | 68 | steps: |
67 | 69 | - name: Require maintainer-level repository access |
| 70 | +id: permission |
68 | 71 | uses: actions/github-script@v8 |
69 | 72 | with: |
70 | 73 | script: | |
@@ -78,14 +81,18 @@ jobs:
|
78 | 81 | const permission = data.permission; |
79 | 82 | core.info(`Actor ${context.actor} permission: ${permission}`); |
80 | 83 | if (!allowed.has(permission)) { |
81 | | - core.setFailed( |
| 84 | + core.notice( |
82 | 85 | `Workflow requires write/maintain/admin access. Actor "${context.actor}" has "${permission}".`, |
83 | 86 | ); |
| 87 | + core.setOutput("authorized", "false"); |
| 88 | + return; |
84 | 89 | } |
| 90 | + core.setOutput("authorized", "true"); |
85 | 91 | |
86 | 92 | resolve_request: |
87 | 93 | name: Resolve Mantis request |
88 | 94 | needs: authorize_actor |
| 95 | +if: needs.authorize_actor.outputs.authorized == 'true' |
89 | 96 | runs-on: ubuntu-24.04 |
90 | 97 | outputs: |
91 | 98 | candidate_ref: ${{ steps.resolve.outputs.candidate_ref }} |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -60,13 +60,17 @@ jobs:
|
60 | 60 | authorize_actor: |
61 | 61 | name: Authorize workflow actor |
62 | 62 | runs-on: blacksmith-8vcpu-ubuntu-2404 |
| 63 | +outputs: |
| 64 | +authorized: ${{ steps.permission.outputs.authorized }} |
63 | 65 | steps: |
64 | 66 | - name: Require maintainer-level repository access |
| 67 | +id: permission |
65 | 68 | uses: actions/github-script@v8 |
66 | 69 | with: |
67 | 70 | script: | |
68 | 71 | if (context.eventName === "schedule") { |
69 | 72 | core.info("Scheduled default-branch QA run; actor permission check is only required for manual dispatch."); |
| 73 | + core.setOutput("authorized", "true"); |
70 | 74 | return; |
71 | 75 | } |
72 | 76 | const allowed = new Set(["admin", "maintain", "write"]); |
@@ -79,14 +83,18 @@ jobs:
|
79 | 83 | const permission = data.permission; |
80 | 84 | core.info(`Actor ${context.actor} permission: ${permission}`); |
81 | 85 | if (!allowed.has(permission)) { |
82 | | - core.setFailed( |
| 86 | + core.notice( |
83 | 87 | `Workflow requires write/maintain/admin access. Actor "${context.actor}" has "${permission}".`, |
84 | 88 | ); |
| 89 | + core.setOutput("authorized", "false"); |
| 90 | + return; |
85 | 91 | } |
| 92 | + core.setOutput("authorized", "true"); |
86 | 93 | |
87 | 94 | validate_selected_ref: |
88 | 95 | name: Validate selected ref |
89 | 96 | needs: authorize_actor |
| 97 | +if: needs.authorize_actor.outputs.authorized == 'true' |
90 | 98 | runs-on: blacksmith-8vcpu-ubuntu-2404 |
91 | 99 | outputs: |
92 | 100 | selected_revision: ${{ steps.validate.outputs.selected_revision }} |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。