adrianjost / actions-surge.sh-teardown

An GitHub Action to TearDown surge.sh projects that match a regex
MIT License
3 stars 1 forks source link

Surge.sh Teardown - GitHub Action

An GitHub Action to TearDown surge.sh projects that match a regex

semantic-release

Release

Inputs

regex - String

Required The regex to match the surge list line.

Example regex:

Example lines:

run surge list to list all your currently active projects

dryrun - Boolean

If set to true or 1, no changes will be made to your surge account. Instead the teardown command will be logged to the console.

ENVs

SURGE_LOGIN

The env variable SURGE_LOGIN must be defined. This is usually your surge.sh email.

SURGE_TOKEN

The env variable SURGE_TOKEN must be defined. You can get your token by running npx surge token in your command line.

Example usage

uses: adrianjost/actions-surge.sh-teardown
with:
  regex: '[2-9]+ months ago'
env:
  SURGE_LOGIN: ${{ secrets.SURGE_LOGIN }}
  SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}
name: Surge Teardown
on:
  schedule:
    # * is a special character in YAML so you have to quote this string
    # run every month
    - cron: "0 0 1 * *"
jobs:
  surge-teardown:
    runs-on: ubuntu-latest
    steps:
      - name: teardown
        uses: adrianjost/actions-surge.sh-teardown
        with:
          # teardown projects older than 2 months
          regex: '[2-9]+ months ago'
        env:
          SURGE_LOGIN: ${{ secrets.SURGE_LOGIN }}
          SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}

Development

Please follow the Angular commit message guidelines to create meaningfull release changelogs.

Run: env INPUT_DRYRUN=true node ./index.js for testing. You might have to install the surge package first (npm i -g surge)