Skip to content

Commit c4eb0cd

Browse files
committed
fix: merge conflict with releases
2 parents 0f74a21 + 2aef1c9 commit c4eb0cd

File tree

5 files changed

+23
-15
lines changed

5 files changed

+23
-15
lines changed

content/download/releases/processing-1286-4.0.1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@
4848
}
4949
]
5050
}
51-
}
51+
}

content/download/releases/processing-1289-4.1.1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@
4848
}
4949
]
5050
}
51-
}
51+
}

content/download/releases/processing-1290-4.1.2.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@
4848
}
4949
]
5050
}
51-
}
51+
}

docs/download.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@ In order to not require an API token on GitHub in development, there is a separa
66

77
## How to show a new release on the download page
88

9-
1. Make sure `npm` is up to date
9+
1. Make sure `npm` is up to date. (Check Node.js version with `node -v` and make sure it corresponds to the version in [`/.github/workflows/deploy.yml`](https://github.com/processing/processing-website/blob/main/.github/workflows/deploy.yml). For example, if the version specified in the deploy.yml file is `node-version: 16.x` then `v16.17.0` would be a match.)
1010
1. Make sure that the release has been published on GitHub
11-
1. Run the script with a GitHub token: `$ GITHUB_TOKEN=SOMETOKENHERE npm run fetchReleases`
12-
1. Edit the [`selected.json`](/content/download/selected.json) file to include the new release tag
13-
1. Make a PR to the `main` branch.
11+
1. Create a [GitHub access token](https://github.com/settings/tokens)
12+
1. Create a git branch to hold your changes
13+
1. Run the script with: `npm run fetchReleases`
14+
1. Enter your GitHub access token when prompted
15+
1. Edit the [`/content/download/selected.json`](/content/download/selected.json) file to include the new release tag
16+
1. Make a pull request to the `main` branch

scripts/fetchReleases.js

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
const readline = require('readline');
12
const { graphql } = require('@octokit/graphql');
23
const fs = require('fs');
34
const path = require('path');
45

5-
const fetchReleases = async () => {
6+
const fetchReleases = async (githubToken) => {
67
const { processing, processing4 } = await graphql(
78
`
89
query {
@@ -50,7 +51,7 @@ const fetchReleases = async () => {
5051
`,
5152
{
5253
headers: {
53-
authorization: `token ${process.env.GITHUB_TOKEN}`
54+
authorization: `token ${githubToken}`
5455
}
5556
}
5657
);
@@ -73,10 +74,14 @@ const fetchReleases = async () => {
7374
});
7475
};
7576

76-
// only fetch if ENV has GITHUB_TOKEN
77-
if (process.env.GITHUB_TOKEN) {
77+
const rl = readline.createInterface({
78+
input: process.stdin,
79+
output: process.stdout
80+
});
81+
82+
rl.question('Please enter your GitHub token: ', (token) => {
83+
rl.close();
84+
7885
console.log('Fetching releases from github.com');
79-
fetchReleases();
80-
} else {
81-
console.log('No GitHub token found. Bypassing fetch of releases');
82-
}
86+
fetchReleases(token);
87+
});

0 commit comments

Comments
 (0)