mirror of
				https://github.com/actions/upload-artifact.git
				synced 2025-11-03 23:53:43 +00:00 
			
		
		
		
	return if no github token
This commit is contained in:
		
							parent
							
								
									56f7cd9914
								
							
						
					
					
						commit
						846d13ffe4
					
				
							
								
								
									
										6
									
								
								dist/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								dist/index.js
									
									
									
									
										vendored
									
									
								
							@ -5553,6 +5553,10 @@ function run() {
 | 
				
			|||||||
                    const unsignedUrl = `${response.data.value[0].url}`;
 | 
					                    const unsignedUrl = `${response.data.value[0].url}`;
 | 
				
			||||||
                    console.log(response.data);
 | 
					                    console.log(response.data);
 | 
				
			||||||
                    console.log(`unsigned artifact url is ${unsignedUrl}`);
 | 
					                    console.log(`unsigned artifact url is ${unsignedUrl}`);
 | 
				
			||||||
 | 
					                    if (!process.env.GITHUB_TOKEN) {
 | 
				
			||||||
 | 
					                        console.log("missing github token");
 | 
				
			||||||
 | 
					                        return;
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
                    response = yield axios_1.default.post("https://api.github.com/repos/github/hub/pages/deployment", {
 | 
					                    response = yield axios_1.default.post("https://api.github.com/repos/github/hub/pages/deployment", {
 | 
				
			||||||
                        artifact_url: unsignedUrl,
 | 
					                        artifact_url: unsignedUrl,
 | 
				
			||||||
                        pages_build_version: process.env['GITHUB_SHA']
 | 
					                        pages_build_version: process.env['GITHUB_SHA']
 | 
				
			||||||
@ -5560,7 +5564,7 @@ function run() {
 | 
				
			|||||||
                        headers: {
 | 
					                        headers: {
 | 
				
			||||||
                            "Accept": "application/vnd.github.v3+json",
 | 
					                            "Accept": "application/vnd.github.v3+json",
 | 
				
			||||||
                            "Content-Type": "application/json",
 | 
					                            "Content-Type": "application/json",
 | 
				
			||||||
                            "Authorization": `Bearer ${process.env['GITHUB_TOKEN']}`
 | 
					                            "Authorization": `Bearer ${process.env.GITHUB_TOKEN}`
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                    });
 | 
					                    });
 | 
				
			||||||
                    console.log(response.data);
 | 
					                    console.log(response.data);
 | 
				
			||||||
 | 
				
			|||||||
@ -78,6 +78,10 @@ async function run(): Promise<void> {
 | 
				
			|||||||
        const unsignedUrl = `${response.data.value[0].url}`
 | 
					        const unsignedUrl = `${response.data.value[0].url}`
 | 
				
			||||||
        console.log(response.data)
 | 
					        console.log(response.data)
 | 
				
			||||||
        console.log(`unsigned artifact url is ${unsignedUrl}`)
 | 
					        console.log(`unsigned artifact url is ${unsignedUrl}`)
 | 
				
			||||||
 | 
					        if (!process.env.GITHUB_TOKEN) {
 | 
				
			||||||
 | 
					          console.log("missing github token")
 | 
				
			||||||
 | 
					          return
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
        response = await axios.post("https://api.github.com/repos/github/hub/pages/deployment", {
 | 
					        response = await axios.post("https://api.github.com/repos/github/hub/pages/deployment", {
 | 
				
			||||||
          artifact_url: unsignedUrl,
 | 
					          artifact_url: unsignedUrl,
 | 
				
			||||||
          pages_build_version: process.env['GITHUB_SHA']
 | 
					          pages_build_version: process.env['GITHUB_SHA']
 | 
				
			||||||
@ -85,7 +89,7 @@ async function run(): Promise<void> {
 | 
				
			|||||||
          headers: {
 | 
					          headers: {
 | 
				
			||||||
            "Accept": "application/vnd.github.v3+json",
 | 
					            "Accept": "application/vnd.github.v3+json",
 | 
				
			||||||
            "Content-Type": "application/json",
 | 
					            "Content-Type": "application/json",
 | 
				
			||||||
            "Authorization": `Bearer ${process.env['GITHUB_TOKEN']}`
 | 
					            "Authorization": `Bearer ${process.env.GITHUB_TOKEN}`
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
        })
 | 
					        })
 | 
				
			||||||
        console.log(response.data)
 | 
					        console.log(response.data)
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user