3c2f3722ff
emit real ESM runtime + declaration outputs for programmatic imports, align package exports/types with built files, and add a no-cjs policy note. Made-with: Cursor
36 lines
1.1 KiB
YAML
36 lines
1.1 KiB
YAML
name: Test get-installation-token
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
id-token: write
|
|
contents: read
|
|
|
|
jobs:
|
|
test-token:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Get installation token
|
|
id: token
|
|
uses: pullfrog/pullfrog/get-installation-token@main
|
|
|
|
- name: Verify token with Node.js
|
|
env:
|
|
GITHUB_TOKEN: ${{ steps.token.outputs.token }}
|
|
run: |
|
|
node -e '
|
|
const res = await fetch("https://api.github.com/installation/repositories?per_page=1", {
|
|
headers: {
|
|
Authorization: "token " + process.env.GITHUB_TOKEN,
|
|
Accept: "application/vnd.github+json",
|
|
},
|
|
});
|
|
if (!res.ok) throw new Error("GET installation/repositories failed: " + res.status + " " + (await res.text()));
|
|
const data = await res.json();
|
|
console.log("authenticated — installation has access to", data.total_count, "repo(s)");
|
|
console.log("first repo:", data.repositories[0].full_name);
|
|
'
|