Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support cleaning up multiple deploys in one run #36

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add post run
  • Loading branch information
kylebjordahl committed Feb 17, 2023
commit f5dd8d35db21956f8f15c46b0805ee2fed590ad3
1 change: 1 addition & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -17,3 +17,4 @@ inputs:
runs:
using: 'node16'
main: 'dist/index.js'
post: 'dist/index.js --post'
14 changes: 13 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
@@ -30,6 +30,11 @@ export async function run(): Promise<void> {
),
)

const replacementsToDeploy = deployments.data.filter(
d =>
// only ones from github actions
d.performed_via_github_app?.slug === 'github-actions',
)
const replacedDeployment = deployments.data.slice(0, 1).shift()

if (!replacedDeployment) {
@@ -125,4 +130,11 @@ export async function run(): Promise<void> {
}
}

run()
switch (process.argv[2]) {
case '--post': {
run()
break
}
default:
run()
}