Skip to content

Commit 3c63400

Browse files
authored
action: update specs (#137)
1 parent a678c67 commit 3c63400

File tree

3 files changed

+88
-0
lines changed

3 files changed

+88
-0
lines changed

.ci/update-specs.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
name: update specs
3+
4+
scms:
5+
githubConfig:
6+
kind: github
7+
spec:
8+
user: '{{ requiredEnv "GIT_USER" }}'
9+
email: '{{ requiredEnv "GIT_EMAIL" }}'
10+
owner: elastic
11+
repository: ecs-logging-nodejs
12+
token: '{{ requiredEnv "GITHUB_TOKEN" }}'
13+
username: '{{ requiredEnv "GIT_USER" }}'
14+
branch: main
15+
16+
actions:
17+
ecs-logging-nodejs:
18+
kind: github/pullrequest
19+
scmid: githubConfig
20+
sourceid: sha
21+
spec:
22+
automerge: false
23+
labels:
24+
- dependencies
25+
title: 'synchronize ecs-logging spec'
26+
description: |-
27+
### What
28+
29+
ECS logging specs automatic sync
30+
31+
### Why
32+
33+
*Changeset*
34+
* https://github.com/elastic/ecs-logging/commit/{{ source "sha" }}
35+
36+
sources:
37+
spec.json:
38+
name: Get specs from json
39+
kind: file
40+
spec:
41+
file: https://raw.githubusercontent.com/elastic/ecs-logging/main/spec/spec.json
42+
43+
sha:
44+
name: Get commit
45+
kind: json
46+
spec:
47+
file: 'https://api.github.com/repos/elastic/ecs-logging/commits?path=spec%2Fspec.json&page=1&per_page=1'
48+
key: ".[0].sha"
49+
50+
targets:
51+
spec.json-update:
52+
name: 'synchronize ecs-logging spec'
53+
kind: file
54+
sourceid: spec.json
55+
scmid: githubConfig
56+
spec:
57+
file: utils/ecs-logging/spec.json

.github/workflows/opentelemetry.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
workflow_run:
66
workflows:
77
- test
8+
- update-specs
89
types: [completed]
910

1011
jobs:

.github/workflows/update-specs.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
# Send PRs to the subscribed ECS Agents if the spec files (JSON) are modified
3+
name: update-specs
4+
5+
on:
6+
workflow_dispatch:
7+
schedule:
8+
- cron: '0 6 * * *'
9+
10+
permissions:
11+
pull-requests: write
12+
contents: write
13+
14+
jobs:
15+
bump:
16+
runs-on: ubuntu-latest
17+
steps:
18+
19+
- uses: actions/checkout@v3
20+
21+
- name: Setup Git
22+
uses: elastic/apm-pipeline-library/.github/actions/setup-git@current
23+
24+
- name: Install Updatecli in the runner
25+
uses: updatecli/updatecli-action@453502948b442d7b9a923de7b40cc7ce8628505c
26+
27+
- name: Run Updatecli
28+
env:
29+
GITHUB_TOKEN: ${{ github.token }}
30+
run: updatecli apply --config ./.ci/update-specs.yml

0 commit comments

Comments
 (0)