Coder Social home page Coder Social logo

donkeysmoke / smokey Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gr2m/release-notifier-action

0.0 0.0 0.0 1.16 MB

GitHub Action to notify repositories about the repository's releases using a GitHub App

License: ISC License

JavaScript 100.00%

smokey's Introduction

release-notifier-action

GitHub Action to notify repositories about the repository's releases using a GitHub App

Build Status

Important: if the release event was created by another GitHub action authenticated with secrets.GITHUB_TOKEN, no workflow is triggered for that release event. To workaround that problem, use a personal access token instead of secrets.GITHUB_TOKEN to create the release event. See Triggering new workflows using a personal access token.

Setup

In order to use the action, you have to register a GitHub app.

  • GitHub App name: set to something like <Your Project> Release Notifier
  • Description: copy/paste most of this repository's Notifier app. Make sure to replace release-notifier-release with <your-project>-release
  • Homepage URL: your repository URL
  • Webhook: remove the check from [ ] Active
  • Repository permissions: Enable Read & Write access for Contents
  • Where can this GitHub App be installed?: Any account (unless you only want installs for repositories with in your account/organization)

Once you are done, generate & download a private key. In your repository, create to secrets:

  1. APP_ID: set to your newly registered App ID
  2. APP_PRIVATE_KEY: set to the contents of the downloaded *.pem file

Usage

Notify repositories only when a release was published. The repository dispatch event type is set to [current repositories full name] release (e.g. gr2m/release-notifier-action release)

name: Release Notification
on:
  release:
    types:
      - published

jobs:
  notify:
    runs-on: ubuntu-latest
    steps:
      - uses: gr2m/release-notifier-action@v1
        with:
          app_id: ${{ secrets.APP_ID }}
          private_key: ${{ secrets.APP_PRIVATE_KEY }}

If you want to notify repositories for all release activity types, you can do

name: Release Notification
on: release

jobs:
  notify:
    runs-on: ubuntu-latest
    steps:
      - uses: gr2m/release-notifier-action@v1
        with:
          app_id: ${{ secrets.APP_ID }}
          private_key: ${{ secrets.APP_PRIVATE_KEY }}

To customize the repository dispatch event type use the dispatch_event_type argument

name: Release Notification
on:
  release:
    types:
      - published

jobs:
  notify:
    runs-on: ubuntu-latest
    steps:
      - uses: gr2m/release-notifier-action@v1
        with:
          app_id: ${{ secrets.APP_ID }}
          private_key: ${{ secrets.APP_PRIVATE_KEY }}
          dispatch_event_type: my-project-release

How it works

Each time you create, edit, or delete a release on your repository, the action will load all installations using the credentials you provided. For each installation, the action dispatch creates a repository dispatch event and sets the event type to what you configured in inputs.dispatchEventType.

License

ISC

smokey's People

Contributors

dependabot[bot] avatar semantic-release-bot avatar gr2m avatar oscard0m 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.