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:
- Title with URL
- Title with URL & body with alias
- URL in body
- 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!
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 }}