Skip to content

Commit 70882b3

Browse files
DEVOPS-47 updating script
1 parent 93d2799 commit 70882b3

3 files changed

Lines changed: 2 additions & 5 deletions

File tree

.github/workflows/create_github_secrets_using_workflow.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
- name: get public key id
4141
id: get-public-key-id
4242
env:
43-
GH_TOKEN: ${{ secrets.DEVWITHKRISHNA_PERSONAL_ACCESS_TOKEN }}
43+
GH_TOKEN: ${{ secrets.DEVWITHKRISHNA_PERSONAL_ACCESS_TOKEN }}
4444
run: |
4545
public_key_id=$(bash get_public_key_id.sh ${{inputs.organization}})
4646
echo "PUBLIC_KEY_ID=$public_key_id" >> $GITHUB_OUTPUT

get_public_key.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,14 @@ if [ -z "$ORGANIZATION" ]; then
99
echo "Usage: $0 <Organization name>"
1010
exit 1
1111
fi
12-
1312
# Making the API call and capturing the response
1413
response=$(curl -sL \
1514
-H "Accept: application/vnd.github+json" \
1615
-H "Authorization: Bearer $GH_TOKEN" \
1716
-H "X-GitHub-Api-Version: 2022-11-28" \
1817
https://api.github.com/orgs/$ORGANIZATION/actions/secrets/public-key)
1918

20-
echo $response
21-
sleep 10
19+
2220
# Checking if the request was successful (status code 200)
2321
if [ ! -z "$response" ]; then
2422
# Extracting the public key from the response

get_public_key_id.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ response=$(curl -sL \
1717
-H "X-GitHub-Api-Version: 2022-11-28" \
1818
https://api.github.com/orgs/$ORGANIZATION/actions/secrets/public-key)
1919

20-
echo $response
2120
sleep 10
2221
# Checking if the request was successful (status code 200)
2322
if [ ! -z "$response" ]; then

0 commit comments

Comments
 (0)