Skip to content
Merged

Typo #45

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 11 additions & 19 deletions .github/workflows/rotate-bdba-token.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
uses: actions/checkout@v4

- name: Generate new BDBA API token
id: generate-bdba-token
id: generate_bdba_token
run: |
# Generate new token from the Black Duck Binary Analysis API
# Using the validity period of 3888000 seconds (45 days)
Expand All @@ -48,21 +48,13 @@ jobs:

- name: Update organization secret
run: |
# Authenticate with the GitHub CLI using the generated token
gh auth login --with-token <<< ${{ steps.generate-github-token.outputs.token }}

# List of specific repositories to update
# Secrets do not work out of the box for BDBA action
# workflow_run trigger requires GH environments and
# environments require repo-scoped secrets
REPOSITORIES=("open-component-model" "ocm-cicd-playground" "ocm-k8s-toolkit" "ocm-controller")

# Loop through each repository and set the secret
for repo in "${REPOSITORIES[@]}"; do
echo "Setting BDBA_API_TOKEN for repository: $repo"
gh secret set BDBA_API_TOKEN \
--repo "open-component-model/$repo" \
--body "${{ steps.generate-bdba-token.outputs.bdba_token }}"
done

echo "BDBA API token successfully rotated for specific repositories at $(date)"
# Authenticate with the GitHub CLI and set the secret on org level
gh auth login --with-token <<< ${{ steps.generate_token.outputs.token }}

gh secret set BDBA_API_TOKEN \
--org open-component-model \
--visibility all \
--body "${{ steps.generate_bdba_token.outputs.bdba_token }}"

echo "BDBA API token successfully rotated at $(date)"

Loading