Skip to content

[Project Automation] Add artifact url and live gutenberg.run url #54304

@bangank36

Description

@bangank36

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
image image image

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

What is the build status

  • There will be 3 status:
    1. in_progress: is when the build workflow has started aka when new PR is made or new commit is pushed to the PR
    2. success: when the workflow_run event has completed and the artifact is available on the API
    3. failure: 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions