-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split CODEOWNERS GHA into separate jobs (#13813)
* split into separate jobs * test addition check * This should pass * this should also pass * This too shall pass * test the delete scenario and bot message * test passed placing back
- Loading branch information
1 parent
9e6a303
commit f093408
Showing
1 changed file
with
31 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,8 +10,8 @@ on: | |
- reopened | ||
|
||
jobs: | ||
check: | ||
name: Check Codeowners | ||
check-additions: | ||
name: Check Codeowners Additions | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
@@ -46,15 +46,38 @@ jobs: | |
message: 'Error: A file (or its parent directories) does not have a CODEOWNERS entry. Please update the .github/CODEOWNERS file and add the entry for the Offending file: ${{ env.offending_file }}' | ||
GITHUB_TOKEN: ${{ env.VA_VSP_BOT_GITHUB_TOKEN }} | ||
|
||
check-deletions: | ||
name: Check Codeowners Deletions | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 2 | ||
|
||
- name: Configure AWS Credentials | ||
uses: aws-actions/configure-aws-credentials@v1-node16 | ||
with: | ||
aws-access-key-id: ${{ secrets.aws_access_key_id }} | ||
aws-secret-access-key: ${{ secrets.aws_secret_access_key }} | ||
aws-region: "us-gov-west-1" | ||
|
||
- name: Get GitHub Bot Token | ||
uses: marvinpinto/[email protected] | ||
with: | ||
ssm_parameter: /devops/VA_VSP_BOT_GITHUB_TOKEN | ||
env_variable_name: VA_VSP_BOT_GITHUB_TOKEN | ||
|
||
- name: Check CODEOWNERS for removal when files deleted | ||
id: check_deleted_files | ||
run: | | ||
chmod +x .github/scripts/check_deleted_files.sh | ||
.github/scripts/check_deleted_files.sh | ||
# - name: Respond to PR if check CODEOWNERS exists for deleted files fails | ||
# if: ${{ failure() }} | ||
# uses: thollander/actions-comment-pull-request@dadb7667129e23f12ca3925c90dc5cd7121ab57e # v2.4.0 | ||
# with: | ||
# message: 'Error: A file (or its parent directories) was deleted but its reference still exists in CODEOWNERS. Please update the .github/CODEOWNERS file and delete the entry for the Offending file: ${{ env.offending_file }}' | ||
# GITHUB_TOKEN: ${{ env.VA_VSP_BOT_GITHUB_TOKEN }} | ||
- name: Respond to PR if check CODEOWNERS exists for deleted files fails | ||
if: ${{ failure() }} | ||
uses: thollander/actions-comment-pull-request@dadb7667129e23f12ca3925c90dc5cd7121ab57e # v2.4.0 | ||
with: | ||
message: 'Error: A file (or its parent directories) was deleted but its reference still exists in CODEOWNERS. Please update the .github/CODEOWNERS file and delete the entry for the Offending file: ${{ env.offending_file }}' | ||
GITHUB_TOKEN: ${{ env.VA_VSP_BOT_GITHUB_TOKEN }} |