-
Notifications
You must be signed in to change notification settings - Fork 12
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
Reimplement the action based on godo and make it more orchestratable #114
Conversation
6703300
to
b1e377d
Compare
fd7104c
to
3a4c56d
Compare
This is a complete rewrite with the goal of being more orchestratable in a broader GitHub Actions context. - Rewritten to use `godo` instead of shelling out to `doctl` for better error handling and overall control of the process. Fixes #112. Fixes #113. - Supports picking up an in-repository (or filesystem really) `app.yaml` (defaults to `.do/app.yaml`, configurable via the `app_spec_location` input) to create the app from instead of having to rely on an already existing app that's then downloaded (though that is still supported). The in-filesystem app spec can also be templated with environment variables automatically (see examples below). Fixes #106. - Prints the build and deploy logs into the Github Action log (configurable via `print_build_logs` and `print_deploy_logs`) and surfaces them as outputs `build_logs` and `deploy_logs`. Fixes #73. - Provides the app's metadata as the output `app`. Fixes #92. **Breaking changes:** - The `images` input is no longer supported. Instead, use env-var-substitution for an in-repository app spec or the `IMAGE_DIGEST_$component-name`/`IMAGE_TAG_$component-name` environment variables to change the respective fields of images in an existing app.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few nits..
.github/release-drafter.yml
Outdated
@@ -47,9 +47,10 @@ autolabeler: | |||
- "**/*.md" | |||
- label: "enhancement" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure *.go should be an enhancement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this was sitting on internal/**/*
I figured I'd keep that semantic by making any Golang change an enhancement. I'm not too fuzzed about this anyway though.
Got an alternative proposal?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went and dropped the filter. I guess PRs should be manually labeled to be enhancement vs. bug fix.
@@ -29,7 +29,8 @@ func main() { | |||
a.Fatalf("failed to get GitHub context: %v", err) | |||
} | |||
|
|||
do := godo.NewFromToken(in.token).Apps | |||
do := godo.NewFromToken(in.token) | |||
do.UserAgent = "do-app-action-delete" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a way to add a version of the action here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Getting the proper version might be tricky, outside of manually updating it. I'll try to see if we can get the commit SHA added easily though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tried for a bit and it seems like the action isn't checked out as a git repository. There's an action_ref
field on the Github context that contains the reference the user used to fetch the action but that also feel kinda meh tbh.
The most reliable way would likely be to hardcode and keep updating it, though I also don't love that 😓 . I'll move forward as-is though, we can enhance this further down the line as we see fit.
fb00d03
to
ee8e544
Compare
This is a complete rewrite with the goal of being more orchestratable in a broader GitHub Actions context.
godo
instead of shelling out todoctl
for better error handling and overall control of the process. Fixes triggering deploy: unable to create-deployment for app: exit status 1 #112. Fixes Deploy fails but the GitHub Action continues to run in a loop #113.app.yaml
(defaults to.do/app.yaml
, configurable via theapp_spec_location
input) to create the app from instead of having to rely on an already existing app that's then downloaded (though that is still supported). The in-filesystem app spec can also be templated with environment variables automatically (see examples below). Fixes Passing Git Tag name as an environment variable #106.print_build_logs
andprint_deploy_logs
) and surfaces them as outputsbuild_logs
anddeploy_logs
. Fixes Add Real-Time Log Display in GitHub Actions Console #73.app
. Fixes Feature Request: Save meta data about the deployment in an artifact #92.Breaking changes:
images
input is no longer supported. Instead, use env-var-substitution for an in-repository app spec or theIMAGE_DIGEST_$component-name
/IMAGE_TAG_$component-name
environment variables to change the respective fields of images in an existing app.