commit
						27df2d7538
					
				
					 3 changed files with 23 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -15,3 +15,4 @@ inputs:
 | 
			
		|||
runs:
 | 
			
		||||
  using: node12
 | 
			
		||||
  main: main.js
 | 
			
		||||
  post: post.js
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										1
									
								
								main.js
									
										
									
									
									
								
							
							
						
						
									
										1
									
								
								main.js
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -78,6 +78,7 @@ async function main() {
 | 
			
		|||
            image,
 | 
			
		||||
            "sleep", "inf"
 | 
			
		||||
        ])
 | 
			
		||||
        core.saveState("container", container)
 | 
			
		||||
        core.endGroup()
 | 
			
		||||
 | 
			
		||||
        core.startGroup("Start container")
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										21
									
								
								post.js
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								post.js
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,21 @@
 | 
			
		|||
const core = require("@actions/core")
 | 
			
		||||
const exec = require("@actions/exec")
 | 
			
		||||
 | 
			
		||||
async function main() {
 | 
			
		||||
    try {
 | 
			
		||||
        const container = core.getState("container")
 | 
			
		||||
        core.saveState("container", "")
 | 
			
		||||
 | 
			
		||||
        if (container) {
 | 
			
		||||
            await exec.exec("docker", [
 | 
			
		||||
                "rm",
 | 
			
		||||
                "--force",
 | 
			
		||||
                container
 | 
			
		||||
            ])
 | 
			
		||||
        }
 | 
			
		||||
    } catch (error) {
 | 
			
		||||
        core.setFailed(error.message)
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
main()
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue