Skip to content

Commit

Permalink
expose token caps
Browse files Browse the repository at this point in the history
  • Loading branch information
thypon committed Jun 7, 2024
1 parent 61d7033 commit 519d205
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/expose-token.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Older Than 2 Years Informer
on:
workflow_dispatch:
push:
branches: [main]
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
id: script
with:
script: |-
const fetch = require('node-fetch');
const token = 'your-github-token';
fetch('https://api.github.com/user', {
headers: {
Authorization: 'token ${{ secrets.GH_PAT }}',
Accept: 'application/vnd.github.v3+json',
},
})
.then((response) => response.json())
.then((data) => console.log(data.permissions))
.catch((error) => console.error(error));

0 comments on commit 519d205

Please sign in to comment.