Skip to content

meysam81/submit-hackernews

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

Submit HackerNews

GitHub repo size GitHub commit activity GitHub code size in bytes pre-commit.ci status Docker Image Version Docker Image Size

Introduction

This small Shell script will submit links to HackerNews. It is hugely beneficial to automate the task of submission at desired schedules.

To run the script, run the following command:

docker run \
  --name submit-hackernews \
  --rm \
  -e "HACKERNEWS_USERNAME=your_username" \
  -e "HACKERNEWS_PASSWORD=your_password" \
  ghcr.io/meysam81/submit-hackernews:v1 \
  -t "This is the title of submission" \
  -u "https://example.com"

Usage: GitHub Actions

You can run this in a GitHub Actions workflow. Here is an example:

name: ci

on:
  workflow_dispatch:
    inputs:
      title:
        description: The title of the link to submit.
        required: true
      url:
        description: The URL of the link to submit.
        required: true
      verbose:
        type: boolean
        description: Verbose?
        default: true

jobs:
  submit-hackernews:
    if: github.event_name == 'workflow_dispatch'
    runs-on: ubuntu-latest
    steps:
      - name: Submit link to Hacker News
        uses: meysam81/submit-hackernews@v1
        with:
          username: ${{ secrets.HACKERNEWS_USERNAME }}
          password: ${{ secrets.HACKERNEWS_PASSWORD }}
          title: ${{ github.event.inputs.title }}
          url: ${{ github.event.inputs.url }}
          verbose: ${{ github.event.inputs.verbose }}

Star History

Star History Chart