Skip to content

Commit

Permalink
测试工作流013723
Browse files Browse the repository at this point in the history
  • Loading branch information
Sevtinge committed Nov 7, 2023
1 parent 284008d commit 2cd2097
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,21 +80,11 @@ jobs:
CHANNEL_ID: ${{ secrets.CHANNEL_ID }}
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
CANARY: ${{ env.APK_FILE_CANARY }}
COMMIT_MESSAGE: |+
New push to Github\!
Branch Main -
```
${{ github.event.head_commit.message }}
```
by `${{ github.event.head_commit.author.name }}`
See commit detail [here](${{ github.event.head_commit.url }})
COMMIT_URL: ${{ github.event.head_commit.url }}
run: |
mkdir -p ${{ github.workspace }}/git_clone
git clone ${{ github.event.repository.url }} ${{ github.workspace }}/git_clone -b ${{ github.ref_name }}
cd ${{ github.workspace }}/git_clone
ESCAPED=`python3 -c 'import json,os,urllib.parse; msg = json.dumps(os.environ["COMMIT_MESSAGE"]); print(urllib.parse.quote(msg if len(msg) <= 1024 else json.dumps(os.environ["COMMIT_URL"])))'`
{ echo -e 'Github Action for Main\n'; git log ${{ github.event.before }}..${{ github.event.after }} --pretty=format:"%h %s"; echo -e " (by ${{ github.event.head_commit.author.name }})"; } > ${{ github.workspace }}/git_log
ESCAPED="$(cat ${{ github.workspace }}/git_log | gawk '{gsub(/[_*[\]()~`>#+=\|{}.!-]/,"\\\\\\\\&")}1' | sed -e 's|"|\\"|g' -e 's|^[0-9a-z]\+|__&__|' | hexdump -v -e '/1 "%02X"' | sed 's/\(..\)/%\1/g')"
cd ${{ github.workspace }}
curl -v "https://api.telegram.org/bot${BOT_TOKEN}/sendMediaGroup?chat_id=${CHANNEL_ID}&media=%5B%7B%22type%22%3A%22document%22%2C%20%22media%22%3A%22attach%3A%2F%2Fcanary%22%2C%22parse_mode%22%3A%22Markdown%22%2C%22caption%22%3A%22${ESCAPED}%22%7D%5D" -F canary="@${CANARY}"

0 comments on commit 2cd2097

Please sign in to comment.