Skip to content

Commit

Permalink
add test for checking pat access to target repo
Browse files Browse the repository at this point in the history
  • Loading branch information
HarriPra committed Mar 21, 2024
1 parent a1eaed2 commit ced2316
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
7 changes: 0 additions & 7 deletions .github/actions/repo-dispatch/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,6 @@ async function run() {//change function name
const [owner, repo] = targetRepo.split('/');
const client = github.getOctokit(token);

console.log("THIS IS THE OWNER " + owner)
console.log("THIS IS THE REPO " + repo)
console.log("THIS IS THE EVENT TYPE " + eventType)
console.log("THIS IS THE CLIENT PAYLOAD " + clientPayload)

console.log("THIS IS THE CLIENT " + JSON.stringify(client))
console.log("THIS IS THE CLIENT, rest, repos " + JSON.stringify(client.rest.repos))
// Send a repository dispatch event to the specified repository
await client.rest.repos.createDispatchEvent({
owner,
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/cross-repo-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ jobs:
run: |
curl -H "Authorization: token $PAT" \
https://api.github.com/repos/${{ github.repository }}
- name: Check PAT Access to Repository
run: |
curl -H "Authorization: token ${{ secrets.PAT }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/UKHSA-Internal/hpod-ukhsa-generate-webform-url-citizen
env:
PAT: ${{ secrets.PAT }}

# - name: Trigger deployment in another repo
# uses: ./.github/actions/repo-dispatch
Expand Down

0 comments on commit ced2316

Please sign in to comment.