From 2ff943190cc62cb1197bd509261957e337b4da19 Mon Sep 17 00:00:00 2001 From: tiennm99 Date: Fri, 24 Apr 2026 09:54:03 +0700 Subject: [PATCH] ci: add mit license + validate workflow workflow runs on push to main and all prs: - docker compose config -q (yaml + env interpolation) - yq extract embedded alloy config - alloy fmt (syntax check) --- alloy/.github/workflows/validate.yml | 33 ++++++++++++++++++++++++++++ alloy/LICENSE | 21 ++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 alloy/.github/workflows/validate.yml create mode 100644 alloy/LICENSE diff --git a/alloy/.github/workflows/validate.yml b/alloy/.github/workflows/validate.yml new file mode 100644 index 0000000..43157ac --- /dev/null +++ b/alloy/.github/workflows/validate.yml @@ -0,0 +1,33 @@ +name: validate + +on: + push: + branches: [main] + pull_request: + +jobs: + validate: + runs-on: ubuntu-latest + env: + # Dummy values so `compose config` doesn't fail on the `:?required` guards. + ALLOY_HOSTNAME: ci + PROM_URL: https://example.com + PROM_USER: "1" + LOKI_URL: https://example.com + LOKI_USER: "1" + GRAFANA_TOKEN: x + steps: + - uses: actions/checkout@v4 + + - name: Validate compose YAML + env interpolation + run: docker compose config -q + + - name: Extract embedded Alloy config + uses: mikefarah/yq@v4 + with: + cmd: yq '.configs.alloy_config.content' docker-compose.yml > config.alloy + + - name: Validate Alloy config syntax + run: | + docker run --rm -v "$PWD/config.alloy:/config.alloy:ro" \ + grafana/alloy:v1.10.0 fmt /config.alloy > /dev/null diff --git a/alloy/LICENSE b/alloy/LICENSE new file mode 100644 index 0000000..ad130e0 --- /dev/null +++ b/alloy/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 tiennm99 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.