Skip to content

Commit

Permalink
add github action 'check_upstream'
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanmilov committed Mar 26, 2021
1 parent 329eacd commit 9c9e747
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/checkupstream.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Check new upstream commits

on:
repository_dispatch:
types: [check_upstream]

jobs:
sync_with_upstream:
runs-on: ubuntu-latest
name: Sync master with upstream latest

steps:
- name: Checkout master
uses: actions/checkout@v2
with:
ref: next

- name: Fetch upstream changes
id: sync
uses: ivanmilov/upstream_check_new_commits@v1
with:
upstream_repository: yshui/picom
upstream_branch: next
target_branch: next_upstream

- name: Check for new commits
if: ${{ steps.sync.outputs.has_new_commits == 'true' }}
run: curl -s -X POST --connect-timeout 10 https://api.telegram.org/bot${{secrets.API_KEY}}/sendMessage -d chat_id=${{secrets.CHAT_ID}} -d parse_mode="Markdown" -d text="New commit in upstream repo ${{github.repository}}"

- name: Notify if new commits
uses: ivanmilov/telegram_notify_action@v1
with:
api_key: ${{secrets.API_KEY}}
chat_id: ${{secrets.CHAT_ID}}
message: "New commit in upstream repo ${{github.repository}}"
if: ${{ steps.sync.outputs.has_new_commits == 'true' }}

0 comments on commit 9c9e747

Please sign in to comment.