Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

action: update specs #199

Merged
merged 1 commit into from
Feb 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .ci/update-specs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
name: update specs

scms:
githubConfig:
kind: github
spec:
user: '{{ requiredEnv "GIT_USER" }}'
email: '{{ requiredEnv "GIT_EMAIL" }}'
owner: elastic
repository: ecs-logging-java
token: '{{ requiredEnv "GITHUB_TOKEN" }}'
username: '{{ requiredEnv "GIT_USER" }}'
branch: main

actions:
ecs-logging-java:
kind: github/pullrequest
scmid: githubConfig
sourceid: sha
spec:
automerge: false
labels:
- dependencies
title: 'synchronize ecs-logging spec'
description: |-
### What

ECS logging specs automatic sync

### Why

*Changeset*
* https://github.com/elastic/ecs-logging/commit/{{ source "sha" }}

sources:
spec.json:
name: Get specs from json
kind: file
spec:
file: https://raw.githubusercontent.com/elastic/ecs-logging/main/spec/spec.json

sha:
name: Get commit
kind: json
spec:
file: 'https://api.github.com/repos/elastic/ecs-logging/commits?path=spec%2Fspec.json&page=1&per_page=1'
key: ".[0].sha"

targets:
spec.json-update:
name: 'synchronize ecs-logging spec'
kind: file
sourceid: spec.json
scmid: githubConfig
spec:
file: ecs-logging-core/src/test/resources/spec/spec.json
1 change: 1 addition & 0 deletions .github/workflows/opentelemetry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
workflows:
- test
- test-reporter
- update-specs
types: [completed]

jobs:
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/update-specs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
# Send PRs to the subscribed ECS Agents if the spec files (JSON) are modified
name: update-specs

on:
workflow_dispatch:
schedule:
- cron: '0 6 * * *'

permissions:
pull-requests: write
contents: write

jobs:
bump:
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v3

- name: Setup Git
uses: elastic/apm-pipeline-library/.github/actions/setup-git@current

- name: Install Updatecli in the runner
uses: updatecli/updatecli-action@453502948b442d7b9a923de7b40cc7ce8628505c

- name: Run Updatecli
env:
GITHUB_TOKEN: ${{ github.token }}
run: updatecli apply --config ./.ci/update-specs.yml