@@ -68,8 +68,19 @@ module.exports = async ({ github, context, core, dry }) => {
6868
6969 // We get here when none of the 10 commits we looked at contained a maintainer map.
7070 // For the master branch, we don't have any fallback options, so we error out.
71+ // In forks without merge-group history, return empty map to allow testing.
72+ if ( branch === 'master' ) {
73+ const isFork = context . repo . owner !== 'NixOS'
74+ if ( isFork ) {
75+ core . warning (
76+ 'No maintainer map found. Using empty map (expected in forks without merge-group history).' ,
77+ )
78+ return { }
79+ }
80+ throw new Error ( 'No maintainer map found.' )
81+ }
82+
7183 // For other branches, we select a suitable fallback below.
72- if ( branch === 'master' ) throw new Error ( 'No maintainer map found.' )
7384
7485 const { stable, version } = classify ( branch )
7586
@@ -109,6 +120,11 @@ module.exports = async ({ github, context, core, dry }) => {
109120 return [ ]
110121 }
111122
123+ // Forks don't have NixOS teams, return empty list
124+ if ( context . repo . owner !== 'NixOS' ) {
125+ return [ ]
126+ }
127+
112128 if ( ! members [ team_slug ] ) {
113129 members [ team_slug ] = github . paginate ( github . rest . teams . listMembersInOrg , {
114130 org : context . repo . owner ,
@@ -304,9 +320,16 @@ module.exports = async ({ github, context, core, dry }) => {
304320 expectedHash : artifact . digest ,
305321 } )
306322
307- const evalLabels = JSON . parse (
323+ const changedPaths = JSON . parse (
308324 await readFile ( `${ pull_number } /changed-paths.json` , 'utf-8' ) ,
309- ) . labels
325+ )
326+ const evalLabels = changedPaths . labels
327+
328+ // Label new package PRs when title contains ": init at" pattern
329+ const hasNewPackages = changedPaths . attrdiff ?. added ?. length > 0
330+ const titleIndicatesNewPackage = / : i n i t a t \b / . test ( pull_request . title )
331+ evalLabels [ '8.has: package (new)' ] =
332+ hasNewPackages && titleIndicatesNewPackage
310333
311334 // TODO: Get "changed packages" information from list of changed by-name files
312335 // in addition to just the Eval results, to make this work for these packages
0 commit comments