ci: add bot notification, switch to PAT

This commit is contained in:
Zane Schepke
2025-10-07 18:18:18 -04:00
parent 449b6c5422
commit 0827d06f47
3 changed files with 44 additions and 10 deletions
+5 -5
View File
@@ -20,7 +20,7 @@ jobs:
- name: Check for new commits
id: check
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.PAT }}
run: |
NEW_COMMITS=$(git rev-list --count --after="$(date -Iseconds -d '23 hours ago')" ${{ github.sha }})
echo "new_commits=$NEW_COMMITS" >> $GITHUB_OUTPUT
@@ -53,14 +53,14 @@ jobs:
tag: "latest"
message: "Automated tag for HEAD commit"
force_push_tag: true
github_token: ${{ secrets.GITHUB_TOKEN }}
github_token: ${{ secrets.PAT }}
tag_exists_error: false
- name: Generate Changelog
id: changelog
uses: requarks/changelog-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.PAT }}
toTag: "nightly"
fromTag: "latest"
writeToFile: false
@@ -84,7 +84,7 @@ jobs:
tag_name: "nightly"
delete_release: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.PAT }}
- name: Get checksum
id: checksum
@@ -124,4 +124,4 @@ jobs:
files: |
${{ github.workspace }}/temp/**/*.apk
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.PAT }}
+34
View File
@@ -0,0 +1,34 @@
name: Send Notifications to Telegram and Matrix
on:
issues:
types: [opened, closed]
release:
types: [published]
jobs:
notify:
runs-on: ubuntu-latest
steps:
- name: Send to Telegram
env:
MESSAGE: |
${{ github.event_name == 'issues' && github.event.action == 'opened' && format('🆕 New Issue #%s: *%s* by %s\n\n%s\n\n[View Issue](%s)', github.event.issue.number, github.event.issue.title, github.event.issue.user.login, (github.event.issue.body || 'No body provided')[:200], github.event.issue.html_url) ||
github.event_name == 'issues' && github.event.action == 'closed' && format('✅ Issue Closed #%s: *%s* by %s\n\n[View Issue](%s)', github.event.issue.number, github.event.issue.title, github.event.issue.user.login, github.event.issue.html_url) ||
github.event_name == 'release' && github.event.action == 'published' && format('🚀 New Release *%s* (%s)\n\n%s\n\n[View Release](%s)', github.event.release.name, github.event.release.tag_name, (github.event.release.body || 'No notes provided')[:200], github.event.release.html_url) }}
run: |
curl -s -X POST "https://api.telegram.org/bot${{ secrets.TELEGRAM_TOKEN }}/sendMessage" \
-d chat_id="${{ vars.TELEGRAM_CHAT_ID }}" \
${{ vars.TELEGRAM_THREAD_ID && format('-d message_thread_id=\"%s\"', vars.TELEGRAM_THREAD_ID) || '' }} \
-d parse_mode="Markdown" \
-d text="$MESSAGE"
- name: Send to Matrix
uses: s3krit/matrix-message-action@v0.0.3
with:
room_id: ${{ vars.MATRIX_ROOM_ID }}
access_token: ${{ secrets.MATRIX_ACCESS_TOKEN }}
server: ${{ vars.MATRIX_HOMESERVER }}
message: |
${{ github.event_name == 'issues' && github.event.action == 'opened' && format('🆕 New Issue #{0}: **{1}** by {2}\n\n{3}\n\n[View Issue]({4})', github.event.issue.number, github.event.issue.title, github.event.issue.user.login, (github.event.issue.body || 'No body provided')[:200], github.event.issue.html_url) ||
github.event_name == 'issues' && github.event.action == 'closed' && format('✅ Issue Closed #{0}: **{1}** by {2}\n\n[View Issue]({3})', github.event.issue.number, github.event.issue.title, github.event.issue.user.login, github.event.issue.html_url) ||
github.event_name == 'release' && github.event.action == 'published' && format('🚀 New Release **{0}** ({1})\n\n{2}\n\n[View Release]({3})', github.event.release.name, github.event.release.tag_name, (github.event.release.body || 'No notes provided')[:200], github.event.release.html_url) }}
+5 -5
View File
@@ -86,20 +86,20 @@ jobs:
tag: "latest"
message: "Automated tag for HEAD commit"
force_push_tag: true
github_token: ${{ secrets.GITHUB_TOKEN }}
github_token: ${{ secrets.PAT }}
tag_exists_error: false
- name: Get latest release
id: latest_release
uses: kaliber5/action-get-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.PAT }}
latest: true
- name: Generate Changelog
id: changelog
uses: requarks/changelog-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.PAT }}
toTag: ${{ steps.latest_release.outputs.tag_name }}
fromTag: "latest"
writeToFile: false
@@ -161,7 +161,7 @@ jobs:
files: |
${{ github.workspace }}/temp/**/*.apk
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.PAT }}
publish-fdroid-public:
runs-on: ubuntu-latest
@@ -172,7 +172,7 @@ jobs:
- name: Dispatch update for fdroid repo
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.PAT }}
repository: wgtunnel/fdroid
event-type: fdroid-update