-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #343 from Hamster45105/auto-repond
Inform users of app criteria
- Loading branch information
Showing
5 changed files
with
78 additions
and
19 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
**Hello**, | ||
|
||
Thanks for opening an app request! Please ensure you have read the [app criteria](https://github.com/ImranR98/apps.obtainium.imranr.dev/blob/main/APP_CRITERIA.md) to confirm that the app you are requesting is suitable for this site. If you haven’t done so already, give it a read now. | ||
|
||
If you realise the app you want is not suitable, please close the discussion. | ||
|
||
If you choose to leave a request for an unsuitable app open, it may be ignored. | ||
|
||
<details> | ||
<summary><i>Deutsch</i></summary> | ||
|
||
**Hallo**, | ||
|
||
vielen Dank, dass Sie eine App-Anfrage gestellt haben! Bitte vergewissern Sie sich, dass Sie die [App-Kriterien](https://github.com/ImranR98/apps.obtainium.imranr.dev/blob/main/APP_CRITERIA.md) gelesen haben, um die Eignung der von Ihnen angefragten App-Konfiguration für diese Website zu überprüfen. Falls Sie dies noch nicht getan haben, lesen Sie bitte die Kriterien jetzt sorgfältig durch. | ||
|
||
Wenn Sie feststellen, dass die von Ihnen gewünschte App nicht geeignet ist, schließen Sie bitte die Diskussion. | ||
|
||
Wenn Sie eine Anfrage für eine ungeeignete App offen lassen, wird sie ignoriert werden. | ||
</details> |
This file contains 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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Auto Respond to App Requests | ||
|
||
on: | ||
discussion: | ||
types: [created] | ||
|
||
permissions: | ||
contents: read | ||
discussions: write | ||
|
||
jobs: | ||
respond: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Post response comment | ||
uses: actions/github-script@v7 | ||
with: | ||
script: | | ||
const fs = require('fs'); | ||
const RESPONSE_CONTENT = fs.readFileSync('.github/discussion_auto_response.md', 'utf8'); | ||
const discussionId = context.payload.discussion.node_id; | ||
const categoryName = context.payload.discussion.category.name; | ||
if (categoryName === 'App Requests') { | ||
const query = ` | ||
mutation($discussionId: ID!, $body: String!) { | ||
addDiscussionComment(input: {discussionId: $discussionId, body: $body}) { | ||
comment { | ||
id | ||
} | ||
} | ||
} | ||
`; | ||
await github.graphql(query, { | ||
discussionId: discussionId, | ||
body: RESPONSE_CONTENT | ||
}); | ||
} |
This file contains 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 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 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