-
Notifications
You must be signed in to change notification settings - Fork 7
44 lines (40 loc) · 1.53 KB
/
simulate.yml
File metadata and controls
44 lines (40 loc) · 1.53 KB
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
name: Simulate
on:
pull_request:
branches: [ master ]
jobs:
run_simulate:
runs-on: ubuntu-latest
if: ${{ github.event.pull_request.head.repo.fork == false }}
outputs:
id: ${{ steps.simulation.outputs.funnel_id }}
steps:
- uses: actions/checkout@v2
- name: Call simulation
id: simulation
run: |
f_id=$(sshpass -p '${{ secrets.FUNNEL_PASS }}' ssh -o StrictHostKeyChecking=no ${{ secrets.FUNNEL_USER }}@${{ secrets.FUNNEL_HOST }} "bash -s" < simulation.sh "${{ github.event.pull_request.head.repo.git_url }}" "${{ github.head_ref }}" "${{ github.event.pull_request.head.sha }}")
echo "::set-output name=funnel_id::$f_id"
send_message:
runs-on: ubuntu-latest
needs: run_simulate
steps:
- uses: actions/checkout@v2
- uses: mshick/add-pr-comment@v1
with:
message: |
Simulation status can be viewed here: http://${{ secrets.FUNNEL_HOST }}:8000/tasks/${{ needs.run_simulate.outputs.id }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
repo-token-user-login: 'github-actions[bot]'
slack_notification:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_CHANNEL: github
SLACK_MESSAGE: |
'Pull request by ${{ github.event.sender.login }} opened: ${{ github.event.pull_request.html_url }}'
SLACK_USERNAME: GitHub Pull Request Report
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}