Skip to content

Commit

Permalink
Build
Browse files Browse the repository at this point in the history
  • Loading branch information
wwerner committed Dec 6, 2024
1 parent f5c91e9 commit 1c493fd
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 55 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ finally upload the changelogs with the action from this repository.
"community.developer.gridx.de
- `discourse_topic_id` - the ID of the Discourse post to reply to. You can find
the ID, e.g., by inspecting your post in the browser and looking for
`data-topic-id="<n>"` in the `article` element. (XPath
`//h1/@data-topic-id`) ![Discourse Topic ID](doc-topic-id.png)
- `discourse_api_key` - your discourse API key. It needs `topics:write` permissions.
![Discourse API Key](doc-discourse-api-key.png)
`data-topic-id="<n>"` in the `article` element. (XPath `//h1/@data-topic-id`)
![Discourse Topic ID](doc-topic-id.png)
- `discourse_api_key` - your discourse API key. It needs `topics:write`
permissions. ![Discourse API Key](doc-discourse-api-key.png)
- `discourse_user` - the discourse user on whose behalf the action should be
executed.
- `github_sha` - the commit hash to put into the post as reference, can be
Expand All @@ -35,7 +35,8 @@ finally upload the changelogs with the action from this repository.

## Instructions

1. Create a topic for your changelogs. This action will be configured to post the changelog as a reply to this topic.
1. Create a topic for your changelogs. This action will be configured to post
the changelog as a reply to this topic.
1. Get the required parameters as described above
1. Configure the action in your GH workflow, preferably on release

Expand Down
2 changes: 1 addition & 1 deletion badges/coverage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 16 additions & 17 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

18 changes: 8 additions & 10 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,10 @@ export async function run(
'Api-Username': discourseUser
}

const post = async (
postBody: string
): Promise<void> => {
if(!postBody?.trim()) {
const post = async (postBody: string): Promise<void> => {
if (!postBody?.trim()) {
core.info('No changes detected. Skipping.')
return;
return
}

// ref: https://docs.discourse.org/#tag/Posts/operation/createTopicPostPM
Expand Down Expand Up @@ -58,14 +56,14 @@ export async function run(
})
}

const postBody = (
content: string,
commit: string
): string => content ? `# Changelog ${new Date().toISOString()}
const postBody = (content: string, commit: string): string =>
content
? `# Changelog ${new Date().toISOString()}
${content}
(sha ${commit.trim()})
` : '';
`
: ''

const contentToPost = contentFile
? fs.readFileSync(contentFile)?.toString()
Expand Down
77 changes: 56 additions & 21 deletions test-post.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,62 @@
## GET /systems/{systemID}/gateways/{gatewayID}/import-power-limit
- :warning: removed the optional property '/allOf[subschema #1: Import power limit]/maxImportTotal' from the response with the '200' status
- added the optional property '/allOf[subschema #1: Import power limit]/maxImportTotalFoo' to the response with the '200' status
- the 'maxImportL2' response's property default value changed from '0.00' to '42.00' for the status '200'

- :warning: removed the optional property '/allOf[subschema #1: Import power
limit]/maxImportTotal' from the response with the '200' status
- added the optional property '/allOf[subschema #1: Import power
limit]/maxImportTotalFoo' to the response with the '200' status
- the 'maxImportL2' response's property default value changed from '0.00' to
'42.00' for the status '200'

## PUT /systems/{systemID}/gateways/{gatewayID}/import-power-limit
- :warning: removed the request property '/allOf[subschema #1: Import power limit]/maxImportTotal'
- :warning: removed the optional property '/allOf[subschema #1: Import power limit]/maxImportTotal' from the response with the '201' status
- added the new optional request property '/allOf[subschema #1: Import power limit]/maxImportTotalFoo'
- the 'maxImportL2' request property default value changed from '0.00' to '42.00'
- added the optional property '/allOf[subschema #1: Import power limit]/maxImportTotalFoo' to the response with the '201' status
- the 'maxImportL2' response's property default value changed from '0.00' to '42.00' for the status '201'

- :warning: removed the request property '/allOf[subschema #1: Import power
limit]/maxImportTotal'
- :warning: removed the optional property '/allOf[subschema #1: Import power
limit]/maxImportTotal' from the response with the '201' status
- added the new optional request property '/allOf[subschema #1: Import power
limit]/maxImportTotalFoo'
- the 'maxImportL2' request property default value changed from '0.00' to
'42.00'
- added the optional property '/allOf[subschema #1: Import power
limit]/maxImportTotalFoo' to the response with the '201' status
- the 'maxImportL2' response's property default value changed from '0.00' to
'42.00' for the status '201'

## GET /systems/{systemID}/tags
- :warning: removed the optional property '/items/allOf[subschema #2]/createdAt' from the response with the '200' status
- added the optional property '/items/allOf[#/components/schemas/AbstractTag]/foo' to the response with the '200' status

- :warning: removed the optional property '/items/allOf[subschema #2]/createdAt'
from the response with the '200' status
- added the optional property
'/items/allOf[#/components/schemas/AbstractTag]/foo' to the response with the
'200' status

## PATCH /systems/{systemID}/tags
- :warning: removed the optional property '/items/allOf[subschema #2]/createdAt' from the response with the '200' status
- added the new optional request property '/items/allOf[#/components/schemas/AbstractTag]/foo'
- added the optional property '/items/allOf[#/components/schemas/AbstractTag]/foo' to the response with the '200' status

- :warning: removed the optional property '/items/allOf[subschema #2]/createdAt'
from the response with the '200' status
- added the new optional request property
'/items/allOf[#/components/schemas/AbstractTag]/foo'
- added the optional property
'/items/allOf[#/components/schemas/AbstractTag]/foo' to the response with the
'200' status

## PUT /systems/{systemID}/tags
- :warning: removed the optional property '/items/allOf[subschema #2]/createdAt' from the response with the '200' status
- added the new optional request property '/items/allOf[#/components/schemas/AbstractTag]/foo'
- added the optional property '/items/allOf[#/components/schemas/AbstractTag]/foo' to the response with the '200' status

- :warning: removed the optional property '/items/allOf[subschema #2]/createdAt'
from the response with the '200' status
- added the new optional request property
'/items/allOf[#/components/schemas/AbstractTag]/foo'
- added the optional property
'/items/allOf[#/components/schemas/AbstractTag]/foo' to the response with the
'200' status

## PUT /systems/{systemID}/tags/{tagName}
- :warning: removed the optional property '/allOf[subschema #2]/createdAt' from the response with the '200' status
- :warning: removed the optional property '/allOf[subschema #2]/createdAt' from the response with the '201' status
- added the optional property '/allOf[#/components/schemas/AbstractTag]/foo' to the response with the '200' status
- added the optional property '/allOf[#/components/schemas/AbstractTag]/foo' to the response with the '201' status

- :warning: removed the optional property '/allOf[subschema #2]/createdAt' from
the response with the '200' status
- :warning: removed the optional property '/allOf[subschema #2]/createdAt' from
the response with the '201' status
- added the optional property '/allOf[#/components/schemas/AbstractTag]/foo' to
the response with the '200' status
- added the optional property '/allOf[#/components/schemas/AbstractTag]/foo' to
the response with the '201' status

0 comments on commit 1c493fd

Please sign in to comment.