Skip to content

feat: add GitHub action outputs #401

Open

Description

@jkowalleck

Description

Current GitHub action has some inputs, then it does something, but it has not usable outputs to check what the results were.
As a user of the GitHub action, i want several outputs, so that i can use them programmatically in GitHub workflows.

  • released: bool(-ish) value that indicates whether a released happened
  • version: (new) semantic version that was calculated. if released was false than this would be the current version detected.
  • tag: VCS tag-name was used for the release. if released was false than this would be empty string.
  • url: Github.com URL for the release. if released is false, then this value is empty string
  • id: Release ID. if released is false, then this value is null
  • assets: JSON array containing information about each uploaded asset, in the format given here (minus the uploader field). if released is false, then this value is an empty JSON list
  • assets-dist: JSON object containing information about each uploaded dist asset, in the format given here (minus the uploader field). if released is false, then this value is an empty JSON object
  • upload_url: URL for uploading assets to the release. if released is false, then this value is an empty string

output inspired by https://github.com/softprops/action-gh-release

Use cases

  • released: python-semantic-release GitHub action might detect that no release should happen. To indicate this, you can check this value. As an example, you can use ${{ steps.<step-id>.outputs.released }} to check if a release happened and control other steps based on that information. For example, a DockerHub release can be skipped, if python-semantic-release did not happen, although the GitHub action ended with success() state.
  • version: As an example, you can use ${{ steps.<step-id>.outputs.version }} to get the version that was currently detected/used for the release.
  • tag: As an example, you can use ${{ steps.<step-id>.outputs.tag }} as an input for https://github.com/marketplace/actions/upload-files-to-a-github-release
  • assets: As an example, you can use ${{ fromJSON(steps.<step-id>.outputs.assets-dist)[0].browser_download_url }} to get the download URL of the first asset. This file can then be downloaded and put in a docker image.
  • asset-dist: As an example, you can use ${{ fromJSON(steps.<step-id>.outputs.assets-dist).wheel.browser_download_url }} to get the download URL of the wheel-dist asset. This file can then be downloaded and put in a docker image.
  • upload_url: As an example, you can use ${{ steps.<step-id>.outputs.upload_url }} as an input for https://github.com/actions/upload-release-asset

Possible implementation

Activity

  1. added
    feature
    on Dec 27, 2021
  2. changed the title [-]add GutHub action outputs[/-] [+]feat: add GutHub action outputs[/+] on Dec 27, 2021
  3. jkowalleck commented on Dec 27, 2021

    @jkowalleck
    Author

    @relekang are you open for the requested feature to have outputs on the GH-action?
    Are you open for pull-requests for it?
    How would you like the ideal implementation to be?

  4. relekang commented on Dec 27, 2021

    @relekang
    Member

    This sounds great, open for pull-requests 😄

  5. jkowalleck commented on Dec 28, 2021

    @jkowalleck
    Author

    any hints/notes on the implementation?
    any hint where to start?
    any constraints architectural-wise or design-specific?

    did not look at your code, yet. i am not certain if all the features may be feasible with current code.
    i might just prepare a PR with the things i actually need and that are low-hanging :)

  6. jkowalleck commented on Jan 4, 2022

    @jkowalleck
    Author

    i might not find the time to implement it in the near future.

    idea and some implementation details should be clear, docs are linked.
    i am not sad if someone else tackles this topic. ;-)

    could you add the "help wanted" label to this very issue, @relekang ?

  7. added
    help-wanted
    on Jan 4, 2022
  8. danth commented on Jan 4, 2022

    @danth
    Contributor

    @jkowalleck done :)

  9. removed
    help-wanted
    on Jan 5, 2022
  10. added
    help-wanted
    on Feb 6, 2022
  11. removed
    help-wanted
    on Oct 23, 2022
  12. added
    help-wanted
    and removed
    help-wanted
    on Nov 13, 2022
  13. jbnjohnathan commented on Feb 24, 2023

    @jbnjohnathan

    +1 on this. Would be very useful. For example I would like to build a docker image and upload it to Github container registry after the version was increased. To do this I both need to know if the version was increased, and what new version number it was increased to.

  14. jkowalleck commented on Feb 24, 2023

    @jkowalleck
    Author

    One year passed, and I still had no time to implement the feature.

    @jbnjohnathan would you go ahead and tackle the thing?

  15. 20 remaining items

  16. added
    needs-update
    on Oct 30, 2024
  17. codejedi365 commented on Nov 14, 2024

    @codejedi365
    Contributor

    Still in backlog

  18. removed
    needs-update
    on Nov 15, 2024
  19. github-actions commented on Jan 15, 2025

    @github-actions

    It has been 60 days since the last update on this confirmed issue. @python-semantic-release/team can you provide an update on the status of this issue?

  20. added
    needs-update
    on Jan 15, 2025
  21. codejedi365 commented on Jan 15, 2025

    @codejedi365
    Contributor

    Still in backlog

  22. removed
    needs-update
    on Jan 16, 2025
  23. github-actions commented on Mar 17, 2025

    @github-actions

    It has been 60 days since the last update on this confirmed issue. @python-semantic-release/team can you provide an update on the status of this issue?

  24. added
    needs-update
    on Mar 17, 2025
  25. codejedi365 commented on Mar 17, 2025

    @codejedi365
    Contributor

    Still in backlog

  26. removed
    needs-update
    on Mar 18, 2025
  27. github-actions commented on May 18, 2025

    @github-actions

    It has been 60 days since the last update on this confirmed issue. @python-semantic-release/team can you provide an update on the status of this issue?

  28. added
    needs-update
    on May 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmedfeaturegood first issueneeds-update

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions