Skip to content

Commit

Permalink
add workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
benStre committed Jan 17, 2024
1 parent 6b0fe0a commit cac72c2
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/update-prs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
const owner = 'your_owner';
const repo = 'your_repo';
const accessToken = 'your_access_token';

const apiUrl = `https://api.github.com/repos/${owner}/${repo}/pulls`;

try {
const response = await fetch(apiUrl, {
headers: {
Authorization: `Bearer ${accessToken}`,
},
});

if (!response.ok) {
throw new Error(`Failed to fetch pull requests: ${response.statusText}`);
}

const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
14 changes: 14 additions & 0 deletions .github/workflows/update-prs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
on:
push:


jobs:
trigger-pr-update:
runs-on: ubuntu-latest

steps:
- name: Setup Node.js
uses: actions/setup-node@v3

- name: Run JavaScript file
run: node ./update-prs.js

0 comments on commit cac72c2

Please sign in to comment.