-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Closed as not planned
Closed as not planned
Copy link
Labels
[Package] Project management automation/packages/project-management-automation/packages/project-management-automation[Type] EnhancementA suggestion for improvement.A suggestion for improvement.
Description
What problem does this address?
A comment should be added to each new PR with the link to live preview sites gutenberg.run
When the preview site is set up, Gutenberg is installed by downloading the ARTIFACT_DOWNLOAD_URL, is it the generated zip from Build Gutenberg Plugin Zip workflow.
So we should create the comment based on the build status of Gutenberg plugin zip
- Last commit
- Status: the artifact build status
- Preview URL: gutenberg.run URL for the PR, in format
http://gutenberg.run/${ pr_number }
- Gutenberg plugin zip: the URL of the built file, currently the file is downloaded by accessing Checks tab on the PR
Something like
success | failure | in_progress |
---|---|---|
What is your proposed solution?
Since the preview site has relied on the Build process , I decided to use workflow_run
event to trigger the workflow Pull request automation which will run tasks on Gutenberg project management automation
How the comment is made
- There should be only 01 build notification comment on each PR so we need a placeholder to check whether the comment is made or not, eg:
gutenberg-run-placeholder:cmt@v1
- octokit.rest.issues.updateComment or octokit.rest.issues.createComment are used for updating a comment
What is the build status
- There will be 3 status:
in_progress
: is when the build workflow has started aka when new PR is made or new commit is pushed to the PRsuccess
: when theworkflow_run
event hascompleted
and the artifact is available on the APIfailure
: when the workflow complete but the artifact is not available on the API
How is the plugin file URL is made
- From the Checks tab, the artifact URL is made of
${ repoHtmlUrl }/suites/${ checkSuiteId }/artifacts/${artifact.id}
, we can grab those via event payload and from the API - There is no straightforward way to grab the artifact URL quickly in upload-artifact, as mentioned here or in the action discussions
Reference
paaljoachim
Metadata
Metadata
Assignees
Labels
[Package] Project management automation/packages/project-management-automation/packages/project-management-automation[Type] EnhancementA suggestion for improvement.A suggestion for improvement.