Skip to content

Commit 56ec9c0

Browse files
using PAT environment variable
1 parent a8bbd93 commit 56ec9c0

8 files changed

+12
-12
lines changed

api/create-repo.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
curl -X POST 'https://api.github.com/orgs/joshjohanning-test-api2/repos' \
4-
--header 'Accept: application/vnd.github.v3+json' \
5-
--header 'Authorization: Bearer xxx' \
3+
curl -X POST 'https://api.github.com/orgs/joshjohanning-emu/repos' \
4+
--header "Accept: application/vnd.github.v3+json" \
5+
--header "Authorization: Bearer ${PAT}" \
66
-d '{"name":"myrepo2","visibility":"internal"}'

api/download-file-from-github-packages.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Notes: This appears to be an undocumented API - use this as a reference to form your own url
44
curl 'https://maven.pkg.github.com/joshjohanning-org/sherlock-heroku-poc-mvn-package/com/sherlock/herokupoc/1.0.0-202201071559/herokupoc-1.0.0-202201071559.jar' \
5-
-H "Authorization: Bearer xxx" \
5+
-H "Authorization: Bearer ${PAT}" \
66
-L \
77
-o herokupoc-1.0.0-202201071559.jar \
88
-v
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
22

33
curl -LX GET 'https://raw.githubusercontent.com/joshjohanning-org/composite-caller-1/main/README.md' \
4-
--header 'Accept: application/vnd.github.v3+json' \
5-
--header 'Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' -O
4+
--header "Accept: application/vnd.github.v3+json" \
5+
--header "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -O

api/download-workflow-artifacts.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
22

33
curl -LX GET 'https://api.github.com/repos/joshjohanning-org/test-permissions/actions/artifacts/140988573/zip' \
4-
--header 'Accept: application/vnd.github.v3+json' \
5-
--header 'Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' -o artifact.zip
4+
--header "Accept: application/vnd.github.v3+json" \
5+
--header "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -o artifact.zip

graphql/create-organization.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
22

33
curl -X POST 'https://api.github.com/graphql' \
4-
-H "Authorization: bearer xxx" \
4+
-H "Authorization: bearer ${PAT}" \
55
--data '{ "query": "mutation ($enterprise_id: ID! $organization_name: String! $admin_logins: [String!]! $billing_email: String!) { createEnterpriseOrganization(input: { enterpriseId: $enterprise_id login: $organization_name billingEmail: $billing_email profileName: $organization_name adminLogins: $admin_logins }) { enterprise { name } organization { id name } } }", "variables":{ "enterprise_id": "xxx123", "organization_name": "my-org-name", "billing_email": "xxx@xxx.com", "admin_logins": [ "joshjohanning", "other-guy" ] } }'

graphql/download-latest-version-from-github-packages.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ link=$(curl 'https://api.github.com/graphql' \
55
-s \
66
-X POST \
77
-H 'content-type: application/json' \
8-
-H "Authorization: Bearer xxx" \
8+
-H "Authorization: Bearer ${PAT}" \
99
--data '{"query":"{ repository(owner: \"joshjohanning-org\", name: \"Wolfringo-github-packages\") {packages(first: 10, packageType: NUGET, names: \"Wolfringo.Commands\") {edges {node {id name packageType versions(first: 100) {nodes { id version files(first: 10) { nodes { name url}}}}}}}}}","variables":{}}' \
1010
| jq -r '.data.repository.packages.edges[].node.versions.nodes[].files.nodes[].url')
1111

graphql/download-specific-version-from-github-packages.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ link=$(curl 'https://api.github.com/graphql' \
88
-s \
99
-X POST \
1010
-H 'content-type: application/json' \
11-
-H "Authorization: Bearer xxx" \
11+
-H "Authorization: Bearer ${PAT}" \
1212
--data '{"query":"{ repository(owner: \"joshjohanning\", name: \"Wolfringo-github-packages\") { packages(first: 10, packageType: NUGET, names: \"Wolfringo.Commands\") { edges { node { id name packageType version(version: \"1.1.2\") { id version files(first: 10) { nodes { name updatedAt size url } } } } } } }}","variables":{}}' \
1313
| jq -r '.data.repository.packages.edges[].node.version.files.nodes[].url')
1414

graphql/list-enterprise-id.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
22

33
curl -X POST 'https://api.github.com/graphql' \
4-
-H "Authorization: bearer xxx" \
4+
-H "Authorization: bearer ${PAT}" \
55
--data '{ "query": "query ($enterprise: String!){ enterprise(slug: $enterprise) { id } }", "variables": { "enterprise": "enterprise-slug" } }'

0 commit comments

Comments
 (0)