Repository navigation
ci: make Document360 user id configurable via CI secret #40881
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -11,6 +11,7 @@ import { Octokit } from '@octokit/rest'; | |||||
|
|
||||||
| const D360_TOKEN = core.getInput('D360_TOKEN'); | ||||||
| const D360_ARTICLE_ID = core.getInput('D360_ARTICLE_ID'); | ||||||
| const D360_USER_ID = core.getInput('D360_USER_ID'); | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: Missing Prompt for AI agents
Suggested change
|
||||||
| const PUBLISH = core.getInput('PUBLISH') === 'true'; | ||||||
| const LTS_VERSIONS = (core.getInput('LTS_VERSIONS') || '7.10').split(',').map((v) => v.trim()); | ||||||
|
|
||||||
|
|
@@ -193,11 +194,15 @@ async function generateTable({ owner, repo } = {}) { | |||||
|
|
||||||
| const forkResponse = await requestDocument360('put', `Articles/${D360_ARTICLE_ID}/fork`, { | ||||||
| lang_code: "en", | ||||||
| user_id: "2511fd00-9558-4826-8d8c-4cc0c110f89c", | ||||||
| user_id: D360_USER_ID, | ||||||
| version_number: response.data.data.version_number, | ||||||
| }); | ||||||
|
|
||||||
| console.log(forkResponse.data); | ||||||
|
|
||||||
| if (!forkResponse.data.success) { | ||||||
| throw new Error(`Failed to fork article: ${JSON.stringify(forkResponse.data.errors)}`); | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
| console.log('Updating article'); | ||||||
|
|
@@ -211,7 +216,7 @@ async function generateTable({ owner, repo } = {}) { | |||||
| console.log('publishing article', updateResponse.data.data.version_number); | ||||||
|
|
||||||
| const forkResponse = await requestDocument360('post', `Articles/${D360_ARTICLE_ID}/en/publish`, { | ||||||
| user_id: "2511fd00-9558-4826-8d8c-4cc0c110f89c", | ||||||
| user_id: D360_USER_ID, | ||||||
| version_number: updateResponse.data.data.version_number, | ||||||
| publish_message: 'Update support versions table via GitHub Action', | ||||||
| }); | ||||||
|
|
||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Validate that
D360_USER_IDis not empty.If the repository secret
D360_USER_IDis not configured, the input will be an empty string. The workflow would then fail at API call time (line 195) with a Document360 error rather than a clear validation error. Adding an upfront check provides immediate, actionable feedback.✅ Proposed validation
const D360_USER_ID = core.getInput('D360_USER_ID'); +if (!D360_USER_ID) { + throw new Error('D360_USER_ID input is required but was not provided'); +} const PUBLISH = core.getInput('PUBLISH') === 'true';🤖 Prompt for AI Agents