Skip to content

Update ocb

Update ocb #330

---
name: on pull_request
"on":
pull_request:
jobs:
judge-exec:
runs-on: ubuntu-24.04
permissions:
contents: read
pull-requests: write
timeout-minutes: 5
outputs:
builder_config_changed: ${{ steps.check_builder_config.outputs.any_changed }}
otelcol_changed: ${{ steps.check_otelcol.outputs.any_changed }}
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Check for changes in builder-config.yaml
id: check_builder_config
uses: tj-actions/changed-files@e0021407031f5be11a464abee9a0776171c79891 # v47.0.1
with:
files: builder-config.yaml
- name: Check for changes in otelcol directory
id: check_otelcol
uses: tj-actions/changed-files@e0021407031f5be11a464abee9a0776171c79891 # v47.0.1
with:
files: |
otelcol/**
lint-dockerfile:
name: Lint Dockerfile
permissions:
contents: read
pull-requests: write
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- uses: hadolint/hadolint-action@2332a7b74a6de0dda2e2221d575162eba76ba5e5 # v3.3.0
with:
dockerfile: Dockerfile
lint-gha:
name: Lint GitHub Actions
permissions:
contents: read
pull-requests: write
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- uses: reviewdog/action-yamllint@f01d8a48fd8d89f89895499fca2cff09f9e9e8c0 # v1.21.0
with:
fail_level: error
reporter: github-pr-review
- uses: reviewdog/action-actionlint@83e4ed25b168066ad8f62f5afbb29ebd8641d982 # v1.69.1
with:
fail_on_error: true
reporter: github-pr-review
generate-otelcol:
name: Generate otelcol code
needs: judge-exec
if: needs.judge-exec.outputs.builder_config_changed == 'true'
permissions:
contents: write
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: true # stefanzweifel/git-auto-commit-action がこの credential を使ふ
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
with:
go-version: '^1.24.0'
- name: Generate otelcol code
run: go generate ./...
working-directory: otelcol
- name: Commit generated code
uses: stefanzweifel/git-auto-commit-action@28e16e81777b558cc906c8750092100bbb34c5e3 # v7.0.0
with:
commit_message: Generate otelcol code
file_pattern: otelcol/*
validate-generated-code:
name: Validate generated otelcol code
needs: generate-otelcol
if: needs.generate-otelcol.result == 'success'
permissions:
contents: read
uses: ./.github/workflows/wf-validate-otelcol.yaml
verify-otelcol-code:
permissions:
contents: read
needs: judge-exec
if: needs.judge-exec.outputs.otelcol_changed == 'true'
uses: ./.github/workflows/wf-validate-otelcol.yaml