Skip to content

Commit c091350

Browse files
committed
update check-codeowners workflow
Signed-off-by: Moritz Wiesinger <[email protected]>
1 parent 442b4ab commit c091350

File tree

1 file changed

+12
-21
lines changed

1 file changed

+12
-21
lines changed

.github/workflows/check-codeowners.yaml

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -21,43 +21,34 @@ concurrency:
2121
cancel-in-progress: true
2222

2323
jobs:
24-
setup-environment:
25-
timeout-minutes: 30
24+
check-codeowners:
2625
runs-on: ubuntu-24.04
2726
if: ${{ github.actor != 'dependabot[bot]' }}
2827
steps:
2928
- uses: actions/checkout@v4
30-
- uses: actions/setup-go@v5
31-
with:
32-
go-version: "1.22.8"
33-
cache: false
34-
- name: Cache Go
35-
id: go-cache
29+
30+
- name: Cache Go Tools
31+
id: go-tools-cache
3632
timeout-minutes: 5
3733
uses: actions/cache@v4
3834
with:
3935
path: |
40-
~/go/bin
41-
~/go/pkg/mod
4236
./.tools
43-
key: go-cache-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
44-
check-codeowners:
45-
runs-on: ubuntu-24.04
46-
needs: [setup-environment]
47-
steps:
48-
- uses: actions/checkout@v4
49-
- name: Gen githubgen tool
50-
if: github.repository == 'open-telemetry/opentelemetry-collector-contrib'
37+
key: go-tools-${{ runner.os }}-${{ hashFiles('internal/tools/go.sum') }}
38+
39+
- name: Install tools
40+
if: github.repository == 'open-telemetry/opentelemetry-collector-contrib' && steps.go-tools-cache.outputs.cache-hit != 'true'
5141
run: |
52-
make githubgen-install
53-
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
42+
make install-tools
43+
5444
- uses: actions/checkout@v4
5545
with:
5646
ref: ${{github.event.pull_request.head.ref}}
5747
repository: ${{github.event.pull_request.head.repo.full_name}}
5848
path: pr
49+
5950
- name: Gen CODEOWNERS
6051
run: |
6152
cd pr
62-
GITHUB_TOKEN=${{ secrets.READ_ORG_AND_USER_TOKEN }} githubgen
53+
GITHUB_TOKEN=${{ secrets.READ_ORG_AND_USER_TOKEN }} ./.tools/githubgen codeowners
6354
git diff -s --exit-code || (echo 'Generated code is out of date, please apply this diff and commit the changes in this PR.' && git diff && exit 1)

0 commit comments

Comments
 (0)