Skip to content

wesleytodd/short

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A URL shortener as a GitHub Action

Test js-standard-style

This action creates a gh-pages branch with a file for each shortened url. Inspired by @mylesborins tweet:

Today in OMG I can't believe you did that... I used HTML to "emulate" a URL shortener

When an issue which has a valid url is labled as shorten, a gh-pages commit will be made with the html redirect. There are a few valid combinations:

  1. Title with URL
  2. Title with URL & body with alias
  3. URL in body
  4. URL and alias in body, new line separated

It might take a second for the GitHub Pages to rebuild, but once you have it you get an index page and a series of directories with index.html's which contain the meta refresh tag <meta http-equiv="refresh" content="0;url=<URL>">.

This was the first time in a while I just did a raondom code thing for fun, it feels good!

Usage

name: URL Shortener
on:
  issues:
    types: [opened, labeled, unlabeled]

jobs:
  shorten:
    runs-on: ubuntu-latest
    steps:
    - uses: wesleytodd/short@v0
      with:
        token: ${{ secrets.GITHUB_TOKEN }}

About

URL shortener as a GitHub Action

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Sponsor this project

 

Packages