File tree 1 file changed +8
-3
lines changed
1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 11
11
workflow_dispatch :
12
12
13
13
jobs :
14
- # Skip the access check for codegen-sh[ bot]
14
+ # Check if the user is a bot
15
15
bot-check :
16
16
runs-on : ubuntu-latest
17
17
outputs :
@@ -26,20 +26,25 @@ jobs:
26
26
echo "is_bot=false" >> $GITHUB_OUTPUT
27
27
fi
28
28
29
+ # Only run access check if not a bot
29
30
access-check :
30
31
needs : bot-check
31
32
if : needs.bot-check.outputs.is_bot != 'true'
32
33
runs-on : ubuntu-latest
34
+ outputs :
35
+ result : ${{ steps.permission_check.outputs.result || 'skipped' }}
33
36
steps :
34
- - uses : actions-cool/check-user-permission@v2
37
+ - id : permission_check
38
+ uses : actions-cool/check-user-permission@v2
35
39
with :
36
40
require : write
37
41
username : ${{ github.triggering_actor }}
38
42
error-if-missing : true
39
43
44
+ # Run unit tests if either bot or has permission
40
45
unit-tests :
41
46
needs : [bot-check, access-check]
42
- if : always() && (needs.bot-check.outputs.is_bot == 'true' || needs.access-check.result == 'success')
47
+ if : always() && (needs.bot-check.outputs.is_bot == 'true' || needs.access-check.result == 'success' || needs.access-check.result == 'skipped' )
43
48
runs-on : ubuntu-latest-8
44
49
steps :
45
50
- uses : actions/checkout@v4
You can’t perform that action at this time.
0 commit comments