dependabot[bot] cba56724f1 Bump clap from 4.0.11 to 4.0.18 (#217)
Bumps [clap](https://github.com/clap-rs/clap) from 4.0.11 to 4.0.18.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v4.0.11...v4.0.18)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-04 21:51:49 -04:00
2020-10-26 00:35:19 -04:00
2020-10-26 00:35:19 -04:00
2021-04-04 10:38:04 -04:00
2022-04-23 23:27:54 -04:00

rfd-notify

Publish Container Dependabot

This tool looks for regular expressions from RedFlagDeals.com forums and will send emails based on matches.

Prerequisites

Usage

USAGE:
    rfd-notify [OPTIONS] --config <config>

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
    -c, --config <config>    Specify path to config
    -d, --dbpath <dbpath>    Specify path to where the embedded database is stored [default: ./deals_db]

Environment Variables

The following environment variables are required:

VARIABLE DESCRIPTION
SENDGRID_API_KEY Key can be created at https://app.sendgrid.com/settings/api_keys
SENDGRID_MAIL_FROM The email address that the email is sent from
SENDGRID_MAIL_TO The email address to notify

Example Configuration

The following configuration can be passed to rfd-notify:

# config.yml
expressions:
 - "rx.?5[6789]0"
 - pizza
 - starbucks

Drone CI

The following works on Drone CI:

# .drone.yml
---
kind: pipeline
type: docker
name: default

steps:

- name: run rfd-notify
  image: ghcr.io/davegallant/rfd-notify
  environment:
   SENDGRID_API_KEY:
    from_secret: sendgrid_api_key
   SENDGRID_MAIL_FROM: notify@rfd-notify.org
   SENDGRID_MAIL_TO: example@example.com

- name: commit db changes
  image: appleboy/drone-git-push
  settings:
    branch: main
    remote_name: origin
    force: false
    commit: true

Github Action

An action can be setup to scan for deals, send a notification and store previously found deals in the repo.

It also requires the corresponding encrypted secrets setup.

# .github/workflows/main.yml

on:
 schedule:
  - cron: '*5 * * * *'
jobs:
  rfd_notify:
    runs-on: ubuntu-latest
    name: rfd-notify
    steps:
      - name: Checkout
        uses: actions/checkout@v2
        with:
          fetch-depth: 0 # speed boost

      - name: Run rfd-notify
        uses: davegallant/rfd-notify@main
        env:
          SENDGRID_API_KEY: ${{ secrets.SENDGRID_API_KEY }}
          SENDGRID_MAIL_FROM: notify@rfd-notify.org
          SENDGRID_MAIL_TO: ${{ secrets.SENDGRID_MAIL_TO }}

      - name: Commit files
        run: |
          git config --local user.email "action@github.com"
          git config --local user.name "RFD Notify"
          git add deals_db/
          git commit -m "Add changes" -a || true

      - name: Push changes
        uses: ad-m/github-push-action@master
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          branch: ${{ github.ref }}
Description
get notified of deals based on regex
Readme GPL-3.0 4.5 MiB
Languages
Python 92.5%
Dockerfile 6.1%
Shell 1.4%