forked from OpenSlides/openslides-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (57 loc) · 2.25 KB
/
create-issue-for-file-updates.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: Create issues if global files change
on:
push:
branches:
- main
paths:
- 'global/meta/models.yml'
- 'global/meta/permission.yml'
jobs:
announce-update:
name: 'Announce updates'
runs-on: ubuntu-latest
if: github.repository_owner == 'OpenSlides'
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v11.7
- name: Create Issue if models.yml was changed
if: contains(steps.changed-files.outputs.modified_files, 'global/meta/models.yml')
uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OS_ISSUE_TITLE: The `models.yml` got updated
OS_FILE_NAME: models.yml
with:
filename: .github/workflows/announce-file-changes-template.md
- name: Create Issue if permission.yml was changed
if: contains(steps.changed-files.outputs.modified_files, 'global/meta/permission.yml')
uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OS_ISSUE_TITLE: The `permission.yml` got updated
OS_FILE_NAME: permission.yml
with:
filename: .github/workflows/announce-file-changes-template.md
steps:
- name: Generate access token
uses: tibdex/github-app-token@v1
id: generate-token
with:
app_id: ${{ secrets.AUTOMATION_APP_ID }}
private_key: ${{ secrets.AUTOMATION_APP_PRIVATE_KEY }}
- name: Send dispatch if models.yml or permission.yml was changed
if: |
contains(steps.changed-files.outputs.modified_files, 'global/meta/models.yml') ||
contains(steps.changed-files.outputs.modified_files, 'global/meta/permission.yml')
uses: peter-evans/repository-dispatch@v2
with:
event-type: models-update
repository: ${{ github.repository_owner }}/openslides-autoupdate-service
token: ${{ steps.generate-token.outputs.token }}
client-payload: '{"body": "Triggered by commit [${{ github.sha }}](${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }})"}'