Code Monkey home page Code Monkey logo

get-latest-release's Introduction

get-latest-release

Get latest release including draft and prerelease. Return information about release.

Difference to other actions which returns latest release is that, this action get access to hiden draft releases.

Inputs

myToken

Required Token to github repository to get access to hidden releases (draft releases)

exclude_types

Exclude some types of releases separated by |. Examples: draft|prerelease, prerelease|release, draft

view_top

Numbers of releases which will be searched. Default value 100.

Outputs

id

Founded release Id

name

Founded release name

tag_name

Founded release tag

created_at

Founded release creation date

draft

Founded release draft type flag (boolean: true, false).

prerelease

Founded release prerelease type flag (boolean: true, false).

url

API URL to release

html_url

URL to HTML page of release

Example usage

steps:
  - uses: actions/checkout@v1
  - name: "call action"
    id: last_release
    uses: InsonusK/[email protected]
    with:
      myToken: ${{ github.token }}
      exclude_types: "release"
      view_top: 1
  - name: "Print result"
    run: |
      echo "id: ${{ steps.last_release.outputs.id }}"
      echo "name: ${{ steps.last_release.outputs.name }}"
      echo "tag_name: ${{ steps.last_release.outputs.tag_name }}"
      echo "created_at: ${{ steps.last_release.outputs.created_at }}"
      echo "draft: ${{ steps.last_release.outputs.draft }}"
      echo "prerelease: ${{ steps.last_release.outputs.prerelease }}"
      echo "url: ${{ steps.last_release.outputs.url }}"
      echo "html_url: ${{ steps.last_release.outputs.html_url }}"

get-latest-release's People

Contributors

insonusk avatar kedoska avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

get-latest-release's Issues

Feature request

First off, thanks for this really simple and great github action ๐Ÿ’ช
It would be even more amazing if it was possible to get the link to the release draft?

Not Passing Required Inputs Still Passed When it Should Fail

Currently, not passing required fields only throws an unhandled promise rejection and should instead fail completely, the step using this action passed with flying colors even though it didn't do anything.

There should be try/catch logic or an upfront sanity check to ensure that required expected values are present and fail/exit if not.

Warning: Unexpected input(s) 'github_token', valid inputs are ['myToken', 'exclude_types', 'view_top']
2
Run InsonusK/[email protected]
6
(node:2373) UnhandledPromiseRejectionWarning: Error: Parameter token or opts.auth is required
7
    at Object.getAuthString (/home/runner/work/_actions/InsonusK/get-latest-release/v1.0.1/dist/index.js:1573:15)
8
    at Object.getOctokitOptions (/home/runner/work/_actions/InsonusK/get-latest-release/v1.0.1/dist/index.js:2853:24)
9
    at Object.getOctokit (/home/runner/work/_actions/InsonusK/get-latest-release/v1.0.1/dist/index.js:1793:39)
10
    at /home/runner/work/_actions/InsonusK/get-latest-release/v1.0.1/dist/index.js:1489:32
11
    at Generator.next (<anonymous>)
12
    at /home/runner/work/_actions/InsonusK/get-latest-release/v1.0.1/dist/index.js:1466:71
13
    at new Promise (<anonymous>)
14
    at module.exports.47.__awaiter (/home/runner/work/_actions/InsonusK/get-latest-release/v1.0.1/dist/index.js:1462:12)
15
    at run (/home/runner/work/_actions/InsonusK/get-latest-release/v1.0.1/dist/index.js:1480:12)
16
    at Object.47 (/home/runner/work/_actions/InsonusK/get-latest-release/v1.0.1/dist/index.js:1539:1)
17
(node:2373) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
18
(node:2373) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Returning empty info

After a maven release:perform
I execute your action. It runs fine, but does not return any outputs...

Execution can be see here: https://github.com/cemartins/AnsibleVaultFx/runs/2151096961?check_suite_focus=true

My workflow is like this:

      - name: Perform release for MacOs
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: mvn --batch-mode -Darguments="-Dmaven.javadoc.skip=true" release:perform -Dusername=$GITHUB_ACTOR -Dpassword=$GITHUB_TOKEN
      - name: Get latest release info
        id: releaseInfo
        uses: InsonusK/[email protected]
        with:
          myToken: ${{ secrets.GITHUB_TOKEN }}
          view_top: 10
      - name: Print release information
        run: |
          echo "id: ${{ steps.releaseInfo.outputs.id }}"
          echo "name: ${{ steps.releaseInfo.outputs.name }}"
          echo "tag_name: ${{ steps.releaseInfo.outputs.tag_name }}"
          echo "created_at: ${{ steps.releaseInfo.outputs.created_atd }}"
          echo "draft: ${{ steps.releaseInfo.outputs.draft }}"
          echo "prerelease: ${{ steps.releaseInfo.outputs.prerelease }}"

Uses deprecated `set-output` command

Running this action generates warnings like:

The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/

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.