zotero-plugin 2.0.1 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/bin/release.js +11 -6
  2. package/package.json +1 -1
package/bin/release.js CHANGED
@@ -49,7 +49,7 @@ const issues = new Set(Array.from(tags).map(parseInt).filter(tag => !isNaN(tag))
49
49
  if ((/^((issue|gh)-)?[0-9]+(-[a-z]+)?$/i).exec(continuous_integration_1.ContinuousIntegration.branch)) {
50
50
  issues.add(parseInt(continuous_integration_1.ContinuousIntegration.branch.replace(/[^0-9]/g, '')));
51
51
  }
52
- async function announce(issue, release) {
52
+ async function announce(issue_number, release) {
53
53
  if (tags.has('noannounce'))
54
54
  return;
55
55
  let build;
@@ -65,18 +65,23 @@ async function announce(issue, release) {
65
65
  reason = ` (${JSON.stringify(continuous_integration_1.ContinuousIntegration.commit_message)})`;
66
66
  reason += `\n\nInstall in Zotero by downloading ${link}, opening the Zotero "Tools" menu, selecting "Add-ons", open the gear menu in the top right, and select "Install Add-on From File...".`;
67
67
  }
68
- const msg = `:robot: this is your friendly neighborhood build bot announcing ${link}${reason}`;
69
- report(msg);
68
+ const body = `:robot: this is your friendly neighborhood build bot announcing ${link}${reason}`;
69
+ report(body);
70
70
  if (dryRun)
71
71
  return;
72
72
  try {
73
- await octokit.issues.createComment({ owner, repo, issue_number: issue, body: msg });
73
+ const locked = (await octokit.issues.get({ owner, repo, issue_number })).data.locked;
74
+ if (locked)
75
+ await octokit.issues.unlock({ owner, repo, issue_number });
76
+ await octokit.issues.createComment({ owner, repo, issue_number, body });
77
+ if (locked)
78
+ await octokit.issues.lock({ owner, repo, issue_number });
74
79
  }
75
80
  catch (error) {
76
- console.log(`Failed to announce '${build}: ${reason}' on ${issue}`); // eslint-disable-line no-console
81
+ console.log(`Failed to announce '${build}: ${reason}' on ${issue_number}`); // eslint-disable-line no-console
77
82
  }
78
83
  if (process.env.GITHUB_ENV)
79
- fs.appendFileSync(process.env.GITHUB_ENV, `XPI_RELEASED=${issue}\n`);
84
+ fs.appendFileSync(process.env.GITHUB_ENV, `XPI_RELEASED=${issue_number}\n`);
80
85
  }
81
86
  async function uploadAsset(release, asset, contentType) {
82
87
  report(`uploading ${path.basename(asset)} to ${release.data.tag_name}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zotero-plugin",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "Zotero plugin builder",
5
5
  "homepage": "https://github.com/retorquere/zotero-plugin/wiki",
6
6
  "bin": {