feat(ci): add github action for creating issues on sdk repos on major/minor spec version updates#31
feat(ci): add github action for creating issues on sdk repos on major/minor spec version updates#31mkurapov wants to merge 8 commits into
Conversation
…/minor spec version updates
| body, | ||
| headers: { | ||
| 'X-GitHub-Api-Version': '2026-03-10' | ||
| } |
There was a problem hiding this comment.
| - [ ] Review the changes in the latest specification | ||
| - [ ] Update the SDK to maintain feature compatibility | ||
| - [ ] Release a new version of the SDK | ||
| - [ ] If applicable, add or update SDK snippets in the Open Payments documentation |
There was a problem hiding this comment.
@melissahenderson should I add more context to this todo item?
f6d12e3 to
99c9a35
Compare
| - name: Check version | ||
| id: check-version | ||
| run: | | ||
| tag_name="${{ github.event.release.tag_name }}" |
There was a problem hiding this comment.
pass github.event.release.tag_name in instead? and steps.check-version.outputs.version below
It's highly recommended to not evaluate expressions directly in the script to avoid script injections and potential SyntaxErrors when the expression is not valid JavaScript code (particularly when it comes to improperly escaped strings).
https://github.com/actions/github-script#passing-inputs-to-the-script
In reality, I think this is very defensive. As I understand it one of the maintainers would need to publish a bad/malicious release tag.
| } | ||
| }); | ||
| } catch (error) { | ||
| core.error(`Failed to create summary issue in interledger/open-payments: ${error.message}`); |
There was a problem hiding this comment.
I think core.error will not fail the job, judging by the docs: https://github.com/actions/toolkit/tree/main/packages/core
| core.error(`Failed to create summary issue in interledger/open-payments: ${error.message}`); | |
| core.setFailed(`Failed to create summary issue in interledger/open-payments: ${error.message}`); |
| ${createdIssueUrls.map(issueUrl => `- [ ] ${issueUrl}`).join('\n')} | ||
|
|
||
| --- | ||
| *This issue was automatically created by the SDK Repo Notifier workflow.*`.replace(/^\s+/gm, ''); |
There was a problem hiding this comment.
this is removing all the spaces between lines. Do we want that? I think gh markdown is friendly to that but I dont think all flavors are (idk about linear)
const body = `## SDK Update Status
This issue tracks the SDK updates.
### Issues
- [ ] item one
- [ ] item two
---
*footer*`;
console.log(body.replace(/^\s+/gm, ''));
Giving:
## SDK Update Status
This issue tracks the SDK updates for the new version of the specifications: [v1.3.0](https://example.com/releases/v1.3.0).
### Issues
- [ ] https://github.com/interledger/open-payments-node/issues/30
- [ ] https://github.com/interledger/open-payments-rust/issues/12
---
*This issue was automatically created by the SDK Repo Notifier workflow.*.replace(/^[ \t]+/gm, '') is preserving it and removing space/tab whitespace.
Maybe not that important unless we start to see problems though.
There was a problem hiding this comment.
Anyway to make this idempotent so we dont create duplicate issues on retry? Before create lookup all issue by title and see if it exists?
IDK if there are any race conditions as well. This workflow running twice at once, both see issue doesnt exist, both create one. Not sure how we'd lock and I guess that part is probably super edge-casey. Retry seems more plausible though.
Context
This PR adds an action to create an "Update to Open Payments Specification" issue for the Node, PHP, Go, Java, .NET and Rust SDKs on every minor (or major) version change of the specification. Example issue: interledger/open-payments-node#30
It also creates a summary issue in open-payments to track all of the SDK update issues, example: interledger/open-payments#810