Skip to content

Instantly share code, notes, and snippets.

@carlos-a-g-h
Last active August 24, 2023 23:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save carlos-a-g-h/31b46d302130a2f836bfa99edaddb693 to your computer and use it in GitHub Desktop.
Save carlos-a-g-h/31b46d302130a2f836bfa99edaddb693 to your computer and use it in GitHub Desktop.
Download a file and upload as a github release (THIS IS NOT LEGAL)
# WARNING: This is not how you should use a CI/CD plaftform, use privately and at your own risk
name: URL uploader
on:
workflow_dispatch:
inputs:
LINK:
type: string
required: true
FILENAME:
type: string
required: true
jobs:
main:
runs-on: ubuntu-latest
steps:
- name: Download the given link
run: wget "${{ inputs.LINK }}" -O "${{ inputs.FILENAME }}"
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: "default"
release_name: "File: ${{ inputs.FILENAME }}"
draft: false
prerelease: false
- name: Upload downloaded file
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: "${{ inputs.FILENAME }}"
asset_name: "${{ inputs.FILENAME }}"
asset_content_type: application/octet-stream
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment