Coder Social home page Coder Social logo

jayfoxrox / github-artifact-url Goto Github PK

View Code? Open in Web Editor NEW
23.0 3.0 3.0 13 KB

A small Python 3 HTTP server to return the latest GitHub Actions artifact URL

License: GNU Affero General Public License v3.0

Python 100.00%
github actions artifact url download http redirect server python python3

github-artifact-url's Introduction

GitHub-artifact-URL

A small Python 3 HTTP server to return the latest GitHub Actions artifact URL given the following conditions:

  • Owner name
  • Repository name
  • Branch name
  • Workflow name
  • Workflow event
  • Artifact name

(Only successful workflows will be considered!)

Donate

If you like my work, a donation would be nice:

Even a small amount does help me and shows appreciation. Thank you!

License

(C) 2020 Jannik Vogel

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License Version 3 as published by the Free Software Foundation.

See LICENSE.md for more information.

github-artifact-url's People

Contributors

jayfoxrox avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

github-artifact-url's Issues

Artifact criteria are hardcoded in source-code

The source code defines a couple of global variables to control which artifact is being looked for.
Ideally the HTTP server would allow arguments or some kind of path, so this server can be hosted to support all public GitHub projects.

For example:

http://server.org/<owner>/<repo>/<branch>/<workflow_name>/<workflow_event>/<artifact_name>

or

http://server.org/?owner=<owner>&repo=<repo>&branch=<branch>&workflow=...

This could also be extended with matching for multiple criteria, although KISS is probably better here.

No public server available

Ideally someone would host this script publicly after implementing #1, so it would be easy to add download URLs for temporary artifacts (such as nightly builds) in static websites.

No error handling

There isn't any error handling currently.

Ideally a descriptive error message would be displayed.

The script could also be extended to redirect error messages to another website to display these errors (to integrate more nicely with a projects website for example).

TypeError: %d format: a number is required, not NoneType

running this command will use 27 requests to the github api
200
Yatopia Build Script
found workflow 640688
200
Traceback (most recent call last):
  File "main.py", line 38, in <module>
    artifact_dict[BRANCH]["java-8"] = get_latest_artifact_url(WORKFLOW_NAME, WORKFLOW_EVENT, ARTIFACT_NAME, OWNER, REPO, BRANCH)
  File "/run/media/simon/778dacfe-6c5b-4d99-aaec-9149f943614d/home/simon/Desktop/code/yatopia-autoupdate/artifact_lib.py", line 72, in get_latest_artifact_url
    print("found workflow_run_id %d" % workflow_run_id)
TypeError: %d format: a number is required, not NoneType

GitHub Actions API requires authentication

Since I have made this tool (not even a week ago), the required permissions for the GitHub Actions API were changed. It no longer works for guests. You need to be authenticated and authorized now.

This tool can't handle that (yet?).

Even then, the artifact URLs themselves are also only for authenticated users, so just redirecting the user is not enough anymore.

In general, I'm really frustrated with how GitHub Actions is being rolled out so far. I feel like half my time is spent working around their issues or guessing what their docs / comments on forums and issues seem to imply about future developments. I don't think I'll continue working on this tool for now (I'd still be happy to accept any pull-request which makes this tool better).

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.