-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(The code was fixed by Pabilo, excellent work as always)
- Loading branch information
1 parent
00a7ff4
commit c3268ba
Showing
3 changed files
with
62 additions
and
27 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,18 @@ | ||
name: Notify Discord on New Issue | ||
|
||
on: | ||
issues: | ||
types: [ opened ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: | | ||
echo 'ISSUE ID: ${{ github.event.issue.id }}' | ||
echo 'PROJECT ITEM ID: ${{ github.event.issue.number }}' | ||
- name: Notify Discord on New Issue | ||
uses: sebastianpopp/discord-action@releases/v2 | ||
with: | ||
webhook: ${{ secrets.CARVERBOT_WEBHOOK }} | ||
message: "${{ github.event.issue.title }}\nhttps://github.com/Team-Immersive-Intelligence/ImmersiveIntelligence-Internal/issues/${{ github.event.issue.number }}" |
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,31 @@ | ||
# Usage: discord_commit <URL> <tail commit hash> <head commit hash> | ||
f=$COMMIT_FROM | ||
t=$COMMIT_TO | ||
generate_post_data() { | ||
cat <<EOF | ||
{ | ||
"content": "", | ||
"tts": false, | ||
"embeds": [ | ||
{ | ||
"id": 652627557, | ||
"title": "Work Progress Report", | ||
"color": 3617648, | ||
"description": "We hereby report that the [**Internal Repository**](https://github.com/Team-Immersive-Intelligence/ImmersiveIntelligence-Internal) has received following new commits\\n \ | ||
$( git log $f...$t --format="[\`%h\`](https://github.com/Team-Immersive-Intelligence/ImmersiveIntelligence-Internal/commit/%h) %s\\n" | tr -d '\n' )", | ||
"color": 2631733, | ||
"fields": [], | ||
"footer": { | ||
"text": "Glory to the Engineer Cause!" | ||
} | ||
} | ||
] | ||
} | ||
EOF | ||
} | ||
# POST request to Discord Webhook | ||
curl \ | ||
-H "Content-Type: application/json" \ | ||
-X POST \ | ||
-d "$(generate_post_data)" \ | ||
"$WEBHOOK" |
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 |
---|---|---|
|
@@ -2,40 +2,26 @@ name: Notify Discord on Push | |
|
||
on: | ||
push: #Trigger On Push | ||
branches: | ||
- 'dev' | ||
- 'dev-Avalon' | ||
- 'dev-ammo-rework' | ||
- 'dev-bastian' | ||
- 'dev-prism' | ||
- 'dev-prism-shotgun' | ||
- 'dev-translations' | ||
branches: | ||
- 'dev' | ||
- 'dev-Avalon' | ||
- 'dev-ammo-rework' | ||
- 'dev-bastian' | ||
- 'dev-prism' | ||
- 'dev-prism-shotgun' | ||
- 'dev-translations' | ||
|
||
jobs: | ||
notify-discord: | ||
continue-on-error: true | ||
name: Optimize Assets | ||
name: Notify Discord | ||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_USERNAME: 'CarverBot' | ||
GITHUB_TOKEN: ${{ secrets.OPTIMIZATION_TOKEN }} | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Read Properties File | ||
id: rp | ||
uses: christian-draeger/[email protected] | ||
with: | ||
path: './gradle.properties' | ||
properties: 'mcmod_Name mcmod_Developer mcmod_URL' | ||
|
||
- name: Notify Discord | ||
env: | ||
WEBHOOK: ${{ secrets.DISCORD_INTERNAL_COMMITS_WEBHOOK }} | ||
MOD_NAME: ${{ steps.rp.outputs.mcmod_Name }} | ||
MOD_DEVOLOPER: ${{ steps.rp.outputs.mcmod_Developer }} | ||
MOD_URL: ${{ steps.rp.outputs.mcmod_URL }} | ||
COMMIT_FROM: ${{ steps.rp.outputs.mcmod_URL }} | ||
COMMIT_TO: ${{ steps.rp.outputs.mcmod_URL }} | ||
run: chmod -R a+rX ./gradle/tools/* ; bash ./gradle/tools/discord_commit.sh -i | ||
COMMIT_FROM: ${{ github.event.push.before }} | ||
COMMIT_TO: ${{ github.event.push.after }} | ||
WEBHOOK: ${{ secrets.COMMITS_WEBHOOK }} | ||
run: chmod -R a+rX .github/workflows/* ; bash ./.github/workflows/discord_commit.sh -i |