Skip to content

Commit

Permalink
Update tg.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
cmliu authored Jan 12, 2024
1 parent e22ffa5 commit 3785ab4
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/tg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,6 @@ jobs:
with:
python-version: 3.8

- name: 读取文件内容
id: read_file
run: |
file_content=$(cat addressesapi.txt)
encoded_content=$(echo "$file_content" | sed 's/#/, /g' | base64)
echo "::set-output name=encoded_content::${encoded_content}"
- name: Get Beijing Time
id: time
run: |
Expand All @@ -37,8 +30,11 @@ jobs:
- name: 执行推送
run: |
while IFS= read -r line; do
ips+="$(echo "$line" | sed 's/#/, /g')"$'\n'
done < addressesapi.txt
message="今日优选 For: ${{ steps.time.outputs.current_time }}
$(echo "${{ steps.read_file.outputs.encoded_content }}" | base64 -d)"
$ips"
wget -qO- "https://api.telegram.org/bot${{ secrets.TG_BOT_TOKEN }}/sendMessage?chat_id=${{ secrets.TG_TESTPD_ID }}&text=$message"

0 comments on commit 3785ab4

Please sign in to comment.