/github-raw-url

Action to convert a normal GitHub url to its corresponding raw url.

Primary LanguageJavaScriptMIT LicenseMIT

GitHub raw url Action

The Action converts a normal GitHub file url to its raw url format.

For example, the raw url of https://github.com/actioncloud/github-raw-url/blob/master/index.js is:

https://raw.githubusercontent.com/actioncloud/github-raw-url/master/index.js

This is the first GitHub Action I created, just take it as another GitHub Actions: Hello World. But it's still useful though you can just write one-line script to do the same conversion job in your workflow configuration.

Inputs

github-url

Required A normal GitHub file url.

Usage

# in your workflow config file
jobs:
  my-workflow-job:
    steps:
    - name: A previous step
      id: previous-step
      uses: <an-action>
    - name: Convert a url
      id: convert-to-raw-url
      # or actioncloud/github-raw-url@master
      uses: actioncloud/github-raw-url@v1
      with:
        github-url: ${{ previous-step.outputs.github-url }}
        github-token: ${{ secrets.GITHUB_TOKEN }}
    - name: Another step
      uses: <another-action>
      with:
        github-raw-url: ${{ convert-to-raw-url.outputs.raw-url }}