-
Notifications
You must be signed in to change notification settings - Fork 0
105 lines (98 loc) · 3.31 KB
/
Copy pathon-pull_request.yaml
File metadata and controls
105 lines (98 loc) · 3.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
---
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@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.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