项目作者: byu-oit

项目描述 :
A GitHub Action for sending Slack notifications
高级语言: JavaScript
项目地址: git://github.com/byu-oit/github-action-slack.git
创建时间: 2020-06-11T06:31:27Z
项目社区:https://github.com/byu-oit/github-action-slack

开源协议:Apache License 2.0

下载


CI
Test

github-action-slack" class="reference-link">BYU logo github-action-slack

A GitHub Action for sending Slack notifications

Sends messages that look like:

Setup

Your Slack workplace will need a (:cancel:) emoji. We’ve provided one in this repo.

Then, all you’ll need is a webhook URL and a channel that you want to post to.

Usage

This is for workflows that run on push or pull_request

  1. on: push
  2. # ...
  3. jobs:
  4. deploy:
  5. runs-on: ubuntu-latest
  6. steps:
  7. # ...
  8. - name: Slack
  9. uses: byu-oit/github-action-slack@v1
  10. if: always()
  11. with:
  12. status: ${{ job.status }}
  13. # You need the quotes (''), otherwise it gets interpreted as a comment
  14. channel: '#slack-bot-testing'
  15. webhook-url: ${{ secrets.slack_webhook_url }}

Contributing

Hopefully this is useful to others at BYU. Feel free to ask me some questions about it, but I make no promises about being able to commit time to support it.

Modifying Source Code

Just run npm install locally. There aren’t many files here, so hopefully it should be pretty straightforward.

Cutting new releases

GitHub Actions will run the entry point from the action.yml. In our case, that happens to be /dist/index.js.

Actions run from GitHub repos. We don’t want to check in node_modules. Hence, we package the app using npm run package.

Then, be sure to create a new GitHub release, following SemVer.