File tree Expand file tree Collapse file tree
.github/actions/setup-codex Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5252 fi
5353 codex --version
5454
55+ - name : Enable Linux user namespaces for bubblewrap
56+ if : ${{ runner.os == 'Linux' && runner.environment == 'github-hosted' }}
57+ shell : bash
58+ run : |
59+ set -euo pipefail
60+
61+ # Codex read-only reviews use bubblewrap. Newer Ubuntu images otherwise
62+ # reject its loopback setup before the first repository command runs.
63+ current_userns="$(sysctl -n kernel.unprivileged_userns_clone 2>/dev/null || true)"
64+ if [[ -n "$current_userns" && "$current_userns" != "1" ]]; then
65+ sudo sysctl -w kernel.unprivileged_userns_clone=1
66+ fi
67+
68+ current_apparmor="$(sysctl -n kernel.apparmor_restrict_unprivileged_userns 2>/dev/null || true)"
69+ if [[ -n "$current_apparmor" && "$current_apparmor" != "0" ]]; then
70+ sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
71+ fi
72+
73+ # Exercise the same read-only, network-isolated backend used by reviews.
74+ # A sandbox regression must stop the job before it can publish a verdict.
75+ codex sandbox --permission-profile :read-only -C "$GITHUB_WORKSPACE" -- /bin/true
76+
5577 - name : Resolve Codex home
5678 shell : bash
5779 run : |
Original file line number Diff line number Diff line change @@ -2346,6 +2346,13 @@ test("agent workflows install pinned CLI releases and keep runner models secret"
23462346 assert . doesNotMatch ( localCheck , / g p t - 5 \. 5 / ) ;
23472347 assert . match ( action , / e n v - u O P E N A I _ A P I _ K E Y [ \s \S ] * - u C L A W S W E E P E R _ I N T E R N A L _ M O D E L / ) ;
23482348 assert . equal ( action . match ( / - - i g n o r e - s c r i p t s / g) ?. length , 2 ) ;
2349+ assert . match ( action , / r u n n e r \. o s = = ' L i n u x ' & & r u n n e r \. e n v i r o n m e n t = = ' g i t h u b - h o s t e d ' / ) ;
2350+ assert . match ( action , / k e r n e l \. u n p r i v i l e g e d _ u s e r n s _ c l o n e = 1 / ) ;
2351+ assert . match ( action , / k e r n e l \. a p p a r m o r _ r e s t r i c t _ u n p r i v i l e g e d _ u s e r n s = 0 / ) ;
2352+ assert . match (
2353+ action ,
2354+ / c o d e x s a n d b o x - - p e r m i s s i o n - p r o f i l e : r e a d - o n l y - C " \$ G I T H U B _ W O R K S P A C E " - - \/ b i n \/ t r u e / ,
2355+ ) ;
23492356 for ( const workflow of workflows ) {
23502357 assert . match ( workflow , / C L A W S W E E P E R _ M O D E L : i n t e r n a l / ) ;
23512358 assert . match ( workflow , / C L A W S W E E P E R _ I N T E R N A L _ M O D E L : \$ \{ \{ s e c r e t s \. C L A W S W E E P E R _ M O D E L \} \} / ) ;
You can’t perform that action at this time.
0 commit comments