Skip to content
This repository has been archived by the owner on May 22, 2023. It is now read-only.

Run create build step on opened _or_ sync actions #23

Open
wants to merge 10 commits into
base: dev
Choose a base branch
from

Conversation

rawestmoreland
Copy link

Run the create build step on opened or synchronize

@rawestmoreland rawestmoreland changed the title opened or sync Run create build step on opened _or_ sync actions Jun 17, 2022
@rawestmoreland
Copy link
Author

Related to issue #21

action.yaml Outdated
@@ -66,7 +66,7 @@ runs:
-H "Accept: application/vnd.heroku+json; version=3" \
-H "Authorization: Bearer ${{ inputs.api-key }}"
- name: Create Build
if: ${{ github.event_name == 'pull_request' && github.event.action == 'synchronize' }}
if: ${{ github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'synchronize') }}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't change. When a review app is created, it automatically has a build process going on. So from the Create App step we can use the data returned to find the output stream URL and curl that URL like it's done in Create Build step.

@pmbanugo
Copy link
Owner

The new change is basically the same as the old one. They both create a new build. What I meant was that the create app endpoint returns data that can be used in a different step to curl the build output without creating a new build like you currently have.

@rawestmoreland
Copy link
Author

rawestmoreland commented Jun 18, 2022

@pmbanugo So it looks like we may need to request the list of builds and then use the output stream URL of index 0 since that's the build most recently started from the create step.

Although not sure if it's safe to assume index 0 will always be the build from the Create app step

@pmbanugo
Copy link
Owner

In this case, 0 will be the correct value because it should be the only build for the app.

@rawestmoreland
Copy link
Author

In this case, 0 will be the correct value because it should be the only build for the app.

Sounds good. The other issue I'm seeing is we need to wait for an app status of created. Not sure if a simple sleep will suffice or if we want to poll the endpoint for the app id.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants