Skip to content

Commit 736ba65

Browse files
authored
Typo (#45)
<!-- 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 3e9b728 commit 736ba65

File tree

1 file changed

+11
-19
lines changed

1 file changed

+11
-19
lines changed

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

Lines changed: 11 additions & 19 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,21 +48,13 @@ jobs:
4848
4949
- name: Update organization secret
5050
run: |
51-
# Authenticate with the GitHub CLI using the generated token
52-
gh auth login --with-token <<< ${{ steps.generate-github-token.outputs.token }}
53-
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")
59-
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)"
51+
# Authenticate with the GitHub CLI and set the secret on org level
52+
gh auth login --with-token <<< ${{ steps.generate_token.outputs.token }}
53+
54+
gh secret set BDBA_API_TOKEN \
55+
--org open-component-model \
56+
--visibility all \
57+
--body "${{ steps.generate_bdba_token.outputs.bdba_token }}"
58+
59+
echo "BDBA API token successfully rotated at $(date)"
60+

0 commit comments

Comments
 (0)