-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (45 loc) · 1.45 KB
/
post-bot.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Rom Poster Bot
on:
push:
paths-ignore:
- '.github/scripts/file_ids.txt'
- 'README.md'
workflow_dispatch:
inputs:
repost:
description: 'MD5 hash of the device you want to Re-Post'
required: false
type: string
env:
GitHubMail: "matt.filetto@outlook.com"
GitHubName: "SigmaDroid-Bot"
GitHubToken: ${{ secrets.GH_TOKEN }}
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
CHAT_IDS: ${{ secrets.CHAT_IDS }}
REPOST_MD5: ${{ github.event.inputs.repost }}
jobs:
post:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Dependencies
run: sudo pip install pyTelegramBotAPI noobstuffs
- name: Set Git Configs & Secrets
run: |
git config --global user.email ${GitHubMail}
git config --global user.name ${GitHubName}
git config --global color.ui true
git config --global credential.helper store
echo "https://${GitHubName}:${GitHubToken}@github.com" > ~/.git-credentials
- name: Run RomPosterBot
run: sudo -E python3 .github/scripts/post.py
- name: Commit and Push Changes
if: ${{ github.event.inputs.repost == null }}
run: |
git fetch && git pull
if [ -f commit_mesg.txt ]; then
COMMIT_MESSAGE=$(cat commit_mesg.txt)
rm commit_mesg.txt
git add . && git commit -sm "$COMMIT_MESSAGE"
git push origin
fi