GithubHelp home page GithubHelp logo

jobs-updater's Introduction

Jobs Updater

The jobs updater is a simple GitHub action application to, given some trigger and a yaml file with a list of jobs (or other links):

- name: My Job
  ...
  url: https://my-job.org/12345

The action will inspect the file to determine lines that are newly added (compared to the parent commit) for a field of interest (e.g., the "url" attribute in a list of jobs), extract this field, and then post to a Slack channel.

img/example.png

This is custom made to help the US-RSE site to have job updates posted to slack!

Quickstart

  1. Create a webhook app and grab the URL and save to SLACK_WEBHOOK in your repository secrets.
  2. Add a GitHub workflow file, as shown below, with your desired triggers.

For more details on the above, keep reading.

1. Slack Setup

You'll want to follow the instructions here to create a webhook for your slack community and channel of interest. This usually means first creating an application and selecting your slack community.

  1. For the kind of app, you'll want to select the first box for incoming webhooks.

You can then use the example to test the webhook with curl

curl -X POST -H 'Content-type: application/json' --data '{"text":"Hello, World!"}' YOUR_WEBHOOK_URL_HERE

Click on "Add new webhook to workspace" and then test the provided url with the bot. Copy the webhook URL and put it in a safe place. We will want to keep this URL as a secret in our eventual GitHub workflow.

2. Usage

Add an GitHub workflow file in .github/workflows to specify the following. Note that the workflow below will do the check and update on any push to main (e.g., a merged pull request).

on:
  push:
    paths:
      - '_data/jobs.yml'
    branches:
      - main

jobs:
  slack-poster:
    runs-on: ubuntu-latest
    name: Run Jobs Slack Poster
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 2

      - id: updater
        name: Job Updater
        uses: rseng/jobs-updater@main
        env:
          SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
        with:
          filename: "_data/jobs.yml"
          key: "url"

      - run: echo ${{ steps.updater.outputs.fields }}
        name: Show New Jobs
        shell: bash

jobs-updater's People

Contributors

jhkennedy avatar vsoch avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.