1393ffb7b8
Made-with: Cursor
33 lines
981 B
YAML
33 lines
981 B
YAML
name: Test get-installation-token
|
|
|
|
on:
|
|
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/repos/" + process.env.GITHUB_REPOSITORY, {
|
|
headers: {
|
|
Authorization: "token " + process.env.GITHUB_TOKEN,
|
|
Accept: "application/vnd.github+json",
|
|
},
|
|
});
|
|
if (!res.ok) throw new Error("GET repo failed: " + res.status + " " + (await res.text()));
|
|
const repo = await res.json();
|
|
console.log("authenticated as installation — repo:", repo.full_name, "private:", repo.private);
|
|
'
|