diff --git a/.ci/update-specs.yml b/.ci/update-specs.yml new file mode 100644 index 0000000..f9bbf02 --- /dev/null +++ b/.ci/update-specs.yml @@ -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-php + token: '{{ requiredEnv "GITHUB_TOKEN" }}' + username: '{{ requiredEnv "GIT_USER" }}' + branch: main + +actions: + ecs-logging-php: + 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: tests/shared/spec/spec.json diff --git a/.github/workflows/opentelemetry.yml b/.github/workflows/opentelemetry.yml new file mode 100644 index 0000000..e91fc5b --- /dev/null +++ b/.github/workflows/opentelemetry.yml @@ -0,0 +1,19 @@ +--- +name: OpenTelemetry Export Trace + +on: + workflow_run: + workflows: + - test + - update-specs + types: [completed] + +jobs: + otel-export-trace: + runs-on: ubuntu-latest + steps: + - uses: elastic/apm-pipeline-library/.github/actions/opentelemetry@current + with: + vaultUrl: ${{ secrets.VAULT_ADDR }} + vaultRoleId: ${{ secrets.VAULT_ROLE_ID }} + vaultSecretId: ${{ secrets.VAULT_SECRET_ID }} diff --git a/.github/workflows/update-specs.yml b/.github/workflows/update-specs.yml new file mode 100644 index 0000000..e7f9d78 --- /dev/null +++ b/.github/workflows/update-specs.yml @@ -0,0 +1,30 @@ +--- +# Open a PR if the shared spec files 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 diff --git a/tests/shared/spec/spec.json b/tests/shared/spec/spec.json new file mode 100644 index 0000000..e69de29