-
Notifications
You must be signed in to change notification settings - Fork 440
46 lines (42 loc) · 1.73 KB
/
notification.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# github actions: https://docs.github.com/en/actions/use-cases-and-examples/building-and-testing/building-and-testing-nodejs
# setup-node: https://github.com/actions/setup-node
name: Notifications
on:
# `pull_request_target` (as opposed to `pull_request`) gives permissions to comment on PRs.
pull_request_target:
branches: [master, feature/*, staging]
# Default = opened + synchronize + reopened.
# We also want "edited" so that changelog notifications runs when PR title is updated.
# https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#pull_request
types:
- edited
- opened
- reopened
- synchronize
# Cancel old jobs when a pull request is updated.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
notify:
if: github.repository == 'aws/aws-toolkit-vscode'
runs-on: ubuntu-latest
permissions:
pull-requests: write
issues: read
steps:
- uses: actions/checkout@v4
if: github.event_name == 'pull_request_target'
with:
fetch-depth: 20
- uses: actions/setup-node@v4
if: github.event_name == 'pull_request_target'
with:
node-version: '20'
- name: Comment about contribution guidelines
uses: actions/github-script@v7
if: github.event_name == 'pull_request_target'
with:
script: |
const notify = require('.github/workflows/notify.js')
await notify({github, context})