Giter Club home page Giter Club logo

action-latest-release-info's Introduction

GitHub Action to Help Getting The Latest Release Info

Add this step in your workflow file

- name: Gets latest created release info
  id: latest_release_info
  uses: jossef/[email protected]
  env:
    GITHUB_TOKEN: ${{ github.token }}

Output Variables

  • id: The Id of the release
  • html_url: The URL users can navigate to in order to view the release
  • upload_url: The URL for uploading assets to the release
  • tag_name: The name of the tag linked with the release
  • name: The name of the release
  • created_at: The creation date of the release
  • draft: The draft of the release

output variables can be accessed after the step is completed via ${{ steps.latest_release_info.outputs.<variable name> }}

Example - Accessing Output Variables

name: Build and Release

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

env:
  GITHUB_TOKEN: ${{ github.token }}

jobs:
  build:
    name: Build and Release
    runs-on: ubuntu-latest
    steps:
    - name: Checkout code
    - uses: actions/checkout@v2

    - name: Build
    # TODO fill in with a step that builds something into ./dist/output.tar

    - name: Automatic release
    # TODO fill in with a step that automates the release process (i'm using semantic releaser)

    - name: Gets latest created release info
      id: latest_release_info
      uses: jossef/[email protected]

    - name: Upload asset to github release page
      id: upload-release-asset
      uses: actions/upload-release-asset@v1
      with:
        upload_url: ${{ steps.latest_release_info.outputs.upload_url }}
        asset_path: ./dist/output.tar
        asset_name: output_${{ steps.latest_release_info.outputs.tag_name }}.tar
        asset_content_type: application/x-tar

Credits

This repo was forked and modified. original - https://github.com/marketplace/actions/get-the-upload-url-for-a-release

action-latest-release-info's People

Contributors

jossef avatar pepoviola avatar dependabot[bot] avatar ihiroky avatar mlveggo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.