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