diff --git a/.github/workflows/on_commit_not_master.yml b/.github/workflows/on_commit_not_master.yml new file mode 100644 index 0000000..311022c --- /dev/null +++ b/.github/workflows/on_commit_not_master.yml @@ -0,0 +1,37 @@ +name: Handle new commit +on: + push: + branches-ignore: + - master +jobs: + build_latex: + runs-on: ubuntu-latest + steps: + - name: Set up Git repository + uses: actions/checkout@v4 + - name: Create resources folder + run: mkdir -p tikz/resource + - name: Compile LaTeX document + uses: xu-cheng/latex-action@v3 + with: + root_file: astro-notebook.tex + texlive_version: 2024 + latexmk_use_xelatex: true + latexmk_shell_escape: true + args: -bibtex -xelatex -file-line-error -halt-on-error -interaction=nonstopmode + - name: Upload PDF file + id: upload-pdf + uses: actions/upload-artifact@v4 + with: + name: PDF + path: astro-notebook.pdf + - name: Send Telegram message + uses: appleboy/telegram-action@master + with: + to: ${{ secrets.TELEGRAM_CHAT_ID }} + token: ${{ secrets.TELEGRAM_TOKEN }} + message: | + ${{ github.actor }} created new commit + Commit message: ${{ github.event.commits[0].message }} + See changes: https://github.com/${{ github.repository }}/commit/${{github.sha}} + Output pdf: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts/${{ steps.upload-pdf.outputs.artifact-id }} diff --git a/.github/workflows/on_commit.yml b/.github/workflows/on_commit_to_master.yml similarity index 96% rename from .github/workflows/on_commit.yml rename to .github/workflows/on_commit_to_master.yml index 4948238..247960d 100644 --- a/.github/workflows/on_commit.yml +++ b/.github/workflows/on_commit_to_master.yml @@ -1,5 +1,8 @@ name: Handle new commit -on: [push] +on: + push: + branches: + - master jobs: build_latex: runs-on: ubuntu-latest diff --git a/.github/workflows/on_new_issue.yml b/.github/workflows/on_new_issue.yml index ea4d692..86d1cdd 100644 --- a/.github/workflows/on_new_issue.yml +++ b/.github/workflows/on_new_issue.yml @@ -3,10 +3,8 @@ on: issues: types: [opened, reopened] jobs: - build_latex: + tg_message: runs-on: ubuntu-latest - permissions: - issues: write steps: - name: Send Telegram message uses: appleboy/telegram-action@master @@ -16,7 +14,12 @@ jobs: message: | ${{ github.event.issue.user.login }} created new issue "${{ github.event.issue.title }}" See more by https://github.com/${{ github.repository }}/issues/${{ github.event.issue.number }} - - name: Add "inbox" label to the issue + issue_labels: + runs-on: ubuntu-latest + permissions: + issues: write + steps: + - name: Add "inbox" and "new" labels to the issue uses: actions-ecosystem/action-add-labels@v1 with: labels: |