-
Notifications
You must be signed in to change notification settings - Fork 3
60 lines (60 loc) · 1.89 KB
/
zulip.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
name: Send Zulip message
on:
push:
branches:
- '**'
tags-ignore:
- '**'
pull_request:
branches:
- '**'
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
name: Checkout files
with:
fetch-depth: '2'
persist-credentials: 'true'
- uses: actions/github-script@v6
with:
script: |
const commits = ${{ toJSON(github.event.commits) }}
for (const commit of commits) {
console.log(commit);
};
const event = ${{ toJSON(github.event) }};
console.log(event);
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v35
- name: Get branch name
id: branchname
run: |
BRANCH=$(echo ${{github.event.ref}} | cut -d'/' -f3)
echo "BRANCH=$BRANCH" >> $GITHUB_ENV
- name: Get ISO code
id: isocode
run: |
ISO=$(echo ${{github.event.repository.name}} | cut -d'-' -f2)
echo "ISO=$ISO" >> $GITHUB_ENV
- name: Logging
id: log
run: |
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
echo "text<<$EOF" >> $GITHUB_OUTPUT
for file in ${{steps.changed-files.outputs.all_modified_files}} ; do
echo "- $file" >> $GITHUB_OUTPUT
done
echo "$EOF" >> $GITHUB_OUTPUT
- name: Send a stream message
uses: zulip/github-actions-zulip/send-message@v1
with:
api-key: ${{ secrets.ZULIP_API_KEY }}
email: "[email protected]"
organization-url: "https://giella.zulipchat.com"
to: "${{env.ISO}}"
type: "stream"
topic: "${{github.event.repository.name}} / ${{env.BRANCH}}"
content: "Changed files in last commit:\n\n${{steps.log.outputs.text}}"