Skip to content

Commit

Permalink
Pass stringified JSON to docker filters
Browse files Browse the repository at this point in the history
  • Loading branch information
Jurre Stender committed Oct 18, 2021
1 parent bd668a3 commit 5e225db
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
5 changes: 3 additions & 2 deletions dist/cleanup/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/cleanup/index.js.map

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions src/cleanup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import Docker from 'dockerode'
export async function run(): Promise<void> {
try {
const docker = new Docker()
await docker.pruneNetworks({filters: {until: '24h'}})
await docker.pruneContainers({filters: {until: '24h'}})
const untilFilter = JSON.stringify({until: '24h'})
await docker.pruneNetworks({filters: untilFilter})
await docker.pruneContainers({filters: untilFilter})
} catch (error) {
core.debug(`Error cleaning up: ${error.message}`)
}
Expand Down

0 comments on commit 5e225db

Please sign in to comment.