diff --git a/.github/workflows/issue-analysis.yml b/.github/workflows/issue-analysis.yml index 5bbea89..ed094ec 100644 --- a/.github/workflows/issue-analysis.yml +++ b/.github/workflows/issue-analysis.yml @@ -23,6 +23,18 @@ jobs: fetch-depth: 1 ref: main + - name: Escape markdown characters + id: escape + run: | + ACTION=$(echo "${{ github.event_name }} ${{ github.event.action }}" | sed 's/_/\\_/g') + TITLE=$(echo "${{ github.event.issue.title }}" | sed 's/_/\\_/g') + DESCRIPTION_COMMENT=$(echo "${{ github.repository }}" | sed 's/_/\\_/g') + DESCRIPTION_ISSUE=$(echo "${{ github.repository }}" | sed 's/_/\\_/g') + echo "action=$ACTION" >> $GITHUB_OUTPUT + echo "title=$TITLE" >> $GITHUB_OUTPUT + echo "comment=$DESCRIPTION_COMMENT" >> $GITHUB_OUTPUT + echo "issue=$DESCRIPTION_ISSUE" >> $GITHUB_OUTPUT + - name: Send message to Telegram id: tg_msg uses: appleboy/telegram-action@master @@ -33,31 +45,14 @@ jobs: debug: true format: markdown message: | - 🔔 **Action**: ${{ github.event_name }} ${{ github.event.action }} [#${{ github.event.issue.number }}](${{ github.event.comment.html_url || github.event.issue.html_url }}) + 🔔 **Action**: ${{ steps.escape.outputs.action }} [#${{ github.event.issue.number }}](${{ github.event.comment.html_url || github.event.issue.html_url }}) 📁 **Repository**: ${{ github.repository }} 👤 **From user**: ${{ github.actor }} 📌 **Title**: ${{ github.event.issue.title }} 💬 **Description**: - ${{ github.event.comment.body || github.event.issue.body }} - - - name: Send action and title only to Telegram (if error sending description) - if: ${{ steps.tg_msg.outcome == 'failure' }} - uses: appleboy/telegram-action@master - continue-on-error: true - with: - token: ${{ secrets.TELEGRAM_API_TOKEN }} - to: ${{ secrets.TELEGRAM_CHANNEL_ID }} - debug: true - format: markdown - message: | - 🔔 **Action**: ${{ github.event_name }} ${{ github.event.action }} [#${{ github.event.issue.number }}](${{ github.event.comment.html_url || github.event.issue.html_url }}) - - 📁 **Repository**: ${{ github.repository }} - 👤 **From user**: ${{ github.actor }} - - 📌 **Title**: ${{ github.event.issue.title }} + ${{ steps.escape.outputs.comment || steps.escape.outputs.issue }} - name: Generate report using AI if: ${{ github.event_name == 'issues' && github.event.action == 'opened'}} diff --git a/.github/workflows/ppa.yml b/.github/workflows/ppa.yml index 1a0f3f7..7778afb 100644 --- a/.github/workflows/ppa.yml +++ b/.github/workflows/ppa.yml @@ -88,10 +88,15 @@ jobs: - name: Build deb package and publish to Launchpad PPA if: ${{ github.event.inputs.Install != 'true' }} + env: + DEB_FULLNAME: "lifailon" + DEB_EMAIL: ${{ secrets.PPA_EMAIL }} + DISTRO: ${{ github.event.inputs.Distro }} + APP_VERSION: ${{ github.event.inputs.Version }} run: | export PATH="/usr/lib/go-1.23/bin:$PATH" - export DEBFULLNAME="lifailon" - export DEBEMAIL="${{ secrets.PPA_EMAIL }}" + export DEBFULLNAME="$DEB_FULLNAME" + export DEBEMAIL="$DEB_EMAIL" echo -e "\n\033[33m>>> Debian template generation\033[0m\n" dh-make-golang make github.com/Lifailon/lazyjournal @@ -120,19 +125,20 @@ jobs: cat debian/rules echo -e "\n\033[33m>>> Update distro name in changelog\033[0m\n" - sed -i "1s/)[[:space:]]\+[^;]\+;/) ${{ github.event.inputs.Distro }};/" debian/changelog + sed -i "1s/)[[:space:]]\+[^;]\+;/) $DISTRO;/" debian/changelog sed -i 's/(Closes: TODO)//' debian/changelog - if [ -n "${{ github.event.inputs.Version }}" ]; then + if [ -n "$APP_VERSION" ]; then echo -e "\n\033[33m>>> Update version in changelog\033[0m\n" VERSION=$(cat debian/changelog | head -n 1 | sed -E "s/.+\(//" | sed -E "s/\).+//" | sed -E "s/-[0-9]+//") - sed -i -E "s/$VERSION-/${{ github.event.inputs.Version }}-/" debian/changelog - mv ../lazyjournal_$VERSION.orig.tar.gz ../lazyjournal_${{ github.event.inputs.Version }}.orig.tar.gz + sed -i -E "s/$VERSION-/$APP_VERSION-/" debian/changelog + mv ../lazyjournal_$VERSION.orig.tar.gz ../lazyjournal_$APP_VERSION.orig.tar.gz echo -e "\n\033[33m>>> Changelog\033[0m\n" cat debian/changelog fi echo -e "\n\033[33m>>> Check build\033[0m\n" + chmod -R +w . dpkg-buildpackage -us -uc -b echo -e "\n\033[33m>>> Build changes\033[0m\n"