Skip to content

Commit

Permalink
fix2
Browse files Browse the repository at this point in the history
  • Loading branch information
lingqiqi5211 committed Dec 26, 2023
1 parent 2154798 commit 97aa8c6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
14 changes: 5 additions & 9 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,12 @@ jobs:
name: HyperCeiler Canary
path: ${{ env.APK_FILE_CANARY }}

- name: commit
- name: Commit
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
text="${{ github.event.head_commit.message }}"
else
mkdir -p ${{ github.workspace }}/git_clone
git clone ${{ github.server_url }}/${{ github.repository }} ${{ github.workspace }}/git_clone -b ${{ github.ref_name }}
cd ${{ github.workspace }}/git_clone
text="$(git log ${{ github.event.before }}..${{ github.event.after }} --pretty=format:'%h %s')"
fi
mkdir -p ${{ github.workspace }}/git_clone
git clone ${{ github.server_url }}/${{ github.repository }} ${{ github.workspace }}/git_clone -b ${{ github.ref_name }}
cd ${{ github.workspace }}/git_clone
text="$(git log ${{ github.event.before }}..${{ github.event.after }} --pretty=format:'%h %s')"
echo "commit=$(echo $text | sed 's/\([][\\`.*^$\/+?{}()=!|:-]\)/\\\1/g')" >> $GITHUB_ENV
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/android_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,10 @@ jobs:
echo "SHA256=$debug" >> $GITHUB_ENV
echo "|Debug|$debug" >> $GITHUB_STEP_SUMMARY
- name: commit
- name: Commit
run: |
echo "COMMIT_MESSAGE=$(git log --format=%B -n 1)" >> $GITHUB_ENV
text="${{ github.event.head_commit.message }}"
echo "commit=$(echo $text | sed 's/\([][\\`.*^$\/+?{}()=!|:-]\)/\\\1/g')" >> $GITHUB_ENV
- name: Post to Debug Group
shell: bash
Expand All @@ -63,9 +64,7 @@ jobs:
**New PR to gitHub\!**
`${{ env.commit }}`
by ${{ github.event.head_commit.author.name }}
run: |
ESCAPED=$(python3 -c 'import json,os,urllib.parse; print(urllib.parse.quote(json.dumps(os.environ["COMMIT_MESSAGE"])))')
cd ${{ github.workspace }}
curl -v "https://api.telegram.org/bot${BOT_TOKEN}/sendMediaGroup?chat_id=${GROUP_DEBUG_ID}&media=%5B%7B%22type%22%3A%22document%22%2C%20%22media%22%3A%22attach%3A%2F%2Fdebug%22%2C%22parse_mode%22%3A%22MarkdownV2%22%2C%22caption%22%3A%22${ESCAPED}%22%7D%5D" -F debug="@${DEBUG}"
curl -v "https://api.telegram.org/bot${BOT_TOKEN}/sendMediaGroup?chat_id=${GROUP_DEBUG_ID}&media=%5B%7B%22type%22:%22document%22,%20%22media%22:%22attach://debug%22,%22parse_mode%22:%22MarkdownV2%22,%22caption%22:${ESCAPED}%7D%5D" -F debug="@${DEBUG}"

0 comments on commit 97aa8c6

Please sign in to comment.