This repository was archived by the owner on Apr 14, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +11
-11
lines changed Expand file tree Collapse file tree 3 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -23,20 +23,14 @@ jobs:
2323 - name : Build Action
2424 if : matrix.source == 'action'
2525 run : npm run build
26- - name : Install Atom with Action
27- if : matrix.source == 'action' && matrix.version == 'stable'
28- uses : ./
2926 - name : Install Atom ${{ matrix.version }} with Action
30- if : matrix.source == 'action' && matrix.version != 'stable'
27+ if : matrix.source == 'action'
3128 uses : ./
3229 with :
3330 version : ${{ matrix.version }}
34- - name : Install Atom with NPM
35- if : matrix.source == 'npm' && matrix.version == 'stable'
36- run : node ./src/action.js
3731 - name : Install Atom ${{ matrix.version }} with NPM
38- if : matrix.source == 'npm' && matrix.version != 'stable'
39- run : node ./src/action.js ${{ matrix.version }}
32+ if : matrix.source == 'npm'
33+ run : node ./src/action.js ${{ matrix.version }} ${{ secrets.GITHUB_TOKEN }}
4034 - name : Don't download to repo directory
4135 run : git add . -N && git diff --name-only --exit-code -- . ':!dist'
4236 - name : Run Specs
Original file line number Diff line number Diff line change @@ -22,8 +22,8 @@ async function run() {
2222 core . error ( "'channel' is deprecated. Please use 'version' instead." ) ;
2323 }
2424 const version = channel || ( process . env . GITHUB_ACTIONS && core . getInput ( "version" ) . toLowerCase ( ) ) || process . argv [ 2 ] || "stable" ;
25- const folder = path . resolve ( process . env . RUNNER_TEMP , process . argv [ 3 ] || "./atom" ) ;
26- const token = ( process . env . GITHUB_ACTIONS && core . getInput ( "token" ) ) || process . argv [ 4 ] || "" ;
25+ const token = ( process . env . GITHUB_ACTIONS && core . getInput ( "token" ) ) || process . argv [ 3 ] || "" ;
26+ const folder = path . resolve ( process . env . RUNNER_TEMP , process . argv [ 4 ] || "./atom" ) ;
2727 core . info ( `version: ${ version } ` ) ;
2828 core . info ( `folder: ${ folder } ` ) ;
2929
Original file line number Diff line number Diff line change @@ -21,6 +21,9 @@ const writeFileAsync = promisify(fs.writeFile);
2121const CHANNELS = [
2222 "stable" ,
2323 "beta" ,
24+ ] ;
25+
26+ const INVALID_CHANNELS = [
2427 "nightly" ,
2528 "dev" ,
2629] ;
@@ -138,6 +141,9 @@ async function printVersions() {
138141}
139142
140143async function findUrl ( version , token ) {
144+ if ( INVALID_CHANNELS . includes ( version ) ) {
145+ throw new Error ( `'${ version } ' is not a valid version.` ) ;
146+ }
141147 if ( CHANNELS . includes ( version ) ) {
142148 const octokit = new Octokit ( { auth : token } ) ;
143149 const { data : releases } = await octokit . rest . repos . listReleases ( {
You can’t perform that action at this time.
0 commit comments