Skip to content

Commit 118e57d

Browse files
authored
Merge pull request #589 from processing/automatic-releases
Automatic Releases Workflow
2 parents 8a33dba + 3f8e87e commit 118e57d

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

.github/workflows/release.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Update Procesing Releases
2+
3+
on:
4+
workflow_dispatch:
5+
6+
permissions:
7+
contents: write
8+
pull-requests: write
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- name: Use Node.js 16
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: 16
19+
- name: Install dependencies
20+
run: npm install
21+
- name: Fetch releases
22+
run: |
23+
npm run fetchReleases
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
26+
- name: Create Pull Request
27+
uses: peter-evans/create-pull-request@v7
28+
with:
29+
title: 'Update releases'
30+
branch: update-releases
31+
add-paths: |
32+
content/download/*.json
33+

scripts/fetchReleases.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,11 @@ const fetchReleases = async (githubToken) => {
7575
});
7676
};
7777

78-
// TODO: Allow for Environment Variable input
78+
if (process.env.GITHUB_TOKEN) {
79+
console.log('Fetching releases from github.com');
80+
fetchReleases(process.env.GITHUB_TOKEN);
81+
return;
82+
}
7983

8084
const rl = readline.createInterface({
8185
input: process.stdin,

0 commit comments

Comments
 (0)