     cp path.join(docsOutputDir, 'api.json'), path.join(buildDir, 'atom-api.json')
 
   grunt.registerTask 'upload-assets', 'Upload the assets to a GitHub release', ->
-    switch process.env.JANKY_BRANCH
+    branchName = process.env.JANKY_BRANCH
+    switch branchName
       when 'stable'
         isPrerelease = false
       when 'beta'


    zipAssets buildDir, assets, (error) ->
      return done(error) if error?
      getAtomDraftRelease isPrerelease, (error, release) ->
        return done(error) if error?
        assetNames = (asset.assetName for asset in assets)
        deleteExistingAssets release, assetNames, (error) ->

    tasks.push(zip.bind(this, buildDir, sourcePath, assetName))
  async.parallel(tasks, callback)

getAtomDraftRelease = (isPrerelease, branchName, callback) ->
  atomRepo = new GitHub({repo: 'atom/atom', token})
  atomRepo.getReleases {prerelease: isPrerelease}, (error, releases=[]) ->
    if error?
