diff --git a/.github/workflows/slack.yml b/.github/workflows/slack.yml new file mode 100644 index 0000000..efeb025 --- /dev/null +++ b/.github/workflows/slack.yml @@ -0,0 +1,38 @@ +# This is a basic workflow to help you get started with Actions + +name: CI + +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the "main" branch + pull_request: + branches: [ "main" ] + + + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 12 + - run: npm install + - run: npm run build + + - name: Post to a Slack channel + id: slack + uses: slackapi/slack-github-action@v1.23.0 + with: + + channel-id: 'C01UUQL01KN' + slack-message: "GitHub build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}" + env: + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} \ No newline at end of file