Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 4 additions & 19 deletions .github/workflows/ultimate-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ on:
types: [opened]
issue_comment:
types: [created]
pull_request_target:
types: [opened, synchronize]


jobs:
Expand Down Expand Up @@ -107,20 +105,7 @@ jobs:
# else
# echo "No issue or pull request number found."
# fi
- name: Check Token Permissions
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { owner, repo } = context.repo;
const username = context.actor; // The user triggering the workflow

const permissions = await github.rest.repos.getCollaboratorPermissionLevel({
owner,
repo,
username
});
console.log('Permissions: ', permissions.data);




Expand All @@ -137,7 +122,7 @@ jobs:
- name: Collect PR stats
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
github-token: ${{ secrets.PAT_TOKEN }}
script: |
try {
const { owner, repo } = context.repo;
Expand Down Expand Up @@ -198,7 +183,7 @@ jobs:
- name: Post Comment
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
github-token: ${{ secrets.PAT_TOKEN }}
script: |
const { owner, repo } = context.repo;
const issue_number = context.payload.pull_request.number;
Expand All @@ -219,7 +204,7 @@ jobs:
if: github.event_name == 'pull_request' && github.event.action == 'opened'
uses: actions/github-script@v6
with:
github-token: ${{secrets.GITHUB_TOKEN}}
github-token: ${{secrets.PAT_TOKEN}}
script: |
const { owner, repo } = context.repo;
const prNumber = context.payload.pull_request.number;
Expand Down