-
Notifications
You must be signed in to change notification settings - Fork 1.2k
62 lines (53 loc) · 1.76 KB
/
label-triggered.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Label Triggered Workflow
on:
issues:
types:
- labeled
pull_request_target:
types:
- labeled
permissions:
contents: read
issues: write
pull-requests: write
jobs:
comment:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
ref: master
- name: Label Commenter
uses: peaceiris/actions-label-commenter@v1
automate_invite:
if: contains(github.event.issue.labels.*.name, 'issue/invite')
runs-on: ubuntu-latest
steps:
- name: Invite on label
uses: vj-abigo/[email protected]
with:
organization: layer5io
label: issue/invite
repo-token: ${{ secrets.GITHUB_TOKEN }}
comment: "We are sending you an invitation to join the Layer5 GitHub Organization. :partying_face: <b>Welcome to the community! 🎉</b><br /><br /> Be sure to :star: [star the projects](../stargazers), if you haven't already.<br />"
env:
INVITE_TOKEN: ${{ secrets.RELEASEDRAFTER_PAT }}
- name: View context attributes
uses: actions/github-script@master
id: set-url
with:
script: |
const url = context.issue.url
return url
result-encoding: string
- name: Get url
run: |
echo "URL=${{steps.set-url.outputs.result}}" >> $GITHUB_ENV
echo "ISSUE=${{steps.set-url.outputs.url}}" >> $GITHUB_ENV
- name: Notify slack
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
uses: pullreminders/slack-action@master
with:
args: '{\"channel\":\"CF9RK4H89\",\"text\":\"An invitation to join the layer5io GitHub org has been sent\"}'
# to the author of: ${{env.URL}}\"}'