Skip to content

Commit

Permalink
Merge pull request #589 from processing/automatic-releases
Browse files Browse the repository at this point in the history
Automatic Releases Workflow
  • Loading branch information
Stefterv authored Dec 12, 2024
2 parents 8a33dba + 3f8e87e commit 118e57d
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Update Procesing Releases

on:
workflow_dispatch:

permissions:
contents: write
pull-requests: write

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 16
uses: actions/setup-node@v4
with:
node-version: 16
- name: Install dependencies
run: npm install
- name: Fetch releases
run: |
npm run fetchReleases
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
title: 'Update releases'
branch: update-releases
add-paths: |
content/download/*.json
6 changes: 5 additions & 1 deletion scripts/fetchReleases.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@ const fetchReleases = async (githubToken) => {
});
};

// TODO: Allow for Environment Variable input
if (process.env.GITHUB_TOKEN) {
console.log('Fetching releases from github.com');
fetchReleases(process.env.GITHUB_TOKEN);
return;
}

const rl = readline.createInterface({
input: process.stdin,
Expand Down

0 comments on commit 118e57d

Please sign in to comment.