Skip to content

Commit 62dc81f

Browse files
authored
Test-exclude (#40)
<!-- markdownlint-disable MD041 --> #### What this PR does / why we need it #### Which issue(s) this PR fixes <!-- Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`. -->
1 parent 95bfe41 commit 62dc81f

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

.github/workflows/rotate-bdba-token.yml

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
uses: actions/checkout@v4
2222

2323
- name: Generate new BDBA API token
24-
id: generate_bdba_token
24+
id: generate-bdba-token
2525
run: |
2626
# Generate new token from the Black Duck Binary Analysis API
2727
# Using the validity period of 3888000 seconds (45 days)
@@ -48,12 +48,21 @@ jobs:
4848

4949
- name: Update organization secret
5050
run: |
51-
# Authenticate with the GitHub CLI and set the secret on org level
52-
gh auth login --with-token <<< ${{ steps.generate_token.outputs.token }}
51+
# Authenticate with the GitHub CLI using the generated token
52+
gh auth login --with-token <<< ${{ steps.generate-bdba-token.outputs.token }}
5353

54-
gh secret set BDBA_API_TOKEN \
55-
--org open-component-model \
56-
--visibility all \
57-
--body "${{ steps.generate_bdba_token.outputs.bdba_token }}"
54+
# List of specific repositories to update
55+
# Secrets do not work out of the box for BDBA action
56+
# workflow_run trigger requires GH environments and
57+
# environments require repo-scoped secrets
58+
REPOSITORIES=("open-component-model" "ocm-cicd-playground" "ocm-k8s-toolkit" "ocm-controller")
5859

59-
echo "BDBA API token successfully rotated at $(date)"
60+
# Loop through each repository and set the secret
61+
for repo in "${REPOSITORIES[@]}"; do
62+
echo "Setting BDBA_API_TOKEN for repository: $repo"
63+
gh secret set BDBA_API_TOKEN \
64+
--repo "open-component-model/$repo" \
65+
--body "${{ steps.generate-bdba-token.outputs.bdba_token }}"
66+
done
67+
68+
echo "BDBA API token successfully rotated for specific repositories at $(date)"

0 commit comments

Comments
 (0)