@@ -14,6 +14,7 @@ name: |-
1414 uses: cloudposse/github-actions-workflows/.github/workflows/ci-codeowners-full.yml@main
1515 with:
1616 is_fork: $\{\{ github.event.pull_request.head.repo.full_name != github.repository \}\}
17+ secrets: inherit
1718 ```
1819on :
1920 workflow_call :
2728 type : string
2829 required : false
2930 default : ' ["ubuntu-latest"]'
30- secrets :
31- github_access_token :
32- description : " GitHub API token"
33- required : false
3431
3532jobs :
36- validate :
33+ syntax :
3734 runs-on : ${{ fromJSON(inputs.runs-on) }}
38- name : " Codeowners validate "
35+ name : Validate Codeowners (syntax)
3936 steps :
4037 - name : Checkout
4138 uses : actions/checkout@v4
4239
4340 -
uses :
mszostok/[email protected] 4441 # Pull request from a fork
4542 name : " Validate CODEOWNERS"
46- if : ${{ inputs.is_fork }}
4743 with :
4844 checks : " syntax,duppatterns"
4945 owner_checker_allow_unowned_patterns : " false"
5046
51- -
uses :
mszostok/[email protected] 47+ owners :
48+ runs-on : ${{ fromJSON(inputs.runs-on) }}
49+ name : Validate Codeowners (owners)
50+ if : ${{ false && ! inputs.is_fork }}
51+ environment : release
52+ steps :
53+ - uses : actions/create-github-app-token@v1
54+ id : github-app
55+ with :
56+ app-id : ${{ vars.BOT_GITHUB_APP_ID }}
57+ private-key : ${{ secrets.BOT_GITHUB_APP_PRIVATE_KEY }}
58+
59+ - name : Checkout
60+ uses : actions/checkout@v4
61+ with :
62+ token : ${{ steps.github-app.outputs.token }}
63+
64+ -
uses :
mszostok/[email protected] 5265 # Main branch / Pull request from the same repo
5366 name : " Validate CODEOWNERS"
54- if : ${{ ! inputs.is_fork }}
5567 with :
5668 # For now, remove "files" check to allow CODEOWNERS to specify non-existent
5769 # files so we can use the same CODEOWNERS file for Terraform and non-Terraform repos
5870 # checks: "files,syntax,owners,duppatterns"
59- checks : " syntax,duppatterns, owners"
71+ checks : " owners"
6072 owner_checker_allow_unowned_patterns : " false"
6173 # Admin GitHub access token is required only if the `owners` check is enabled
62- github_access_token : " ${{ secrets.github_access_token }}"
74+ github_access_token : ${{ steps.github-app.outputs.token }}
75+
0 commit comments