Highly-opinionated (ex-bullshit-free) MTPROTO proxy for Telegram. If you use v1.0 or upgrade broke you proxy, please read the chapter Version 2
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

sync-upstream.yml 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. name: Sync with upstream
  2. on:
  3. schedule:
  4. - cron: "0 8 1 * *"
  5. workflow_dispatch:
  6. jobs:
  7. sync:
  8. runs-on: ubuntu-latest
  9. permissions:
  10. contents: write
  11. issues: write
  12. steps:
  13. - uses: actions/checkout@v4
  14. with:
  15. fetch-depth: 0
  16. - name: Add upstream remote
  17. run: git remote add upstream https://github.com/9seconds/mtg.git
  18. - name: Fetch upstream
  19. run: git fetch upstream
  20. - name: Check for new commits
  21. id: check
  22. run: |
  23. COUNT=$(git rev-list --count HEAD..upstream/master)
  24. echo "count=$COUNT" >> "$GITHUB_OUTPUT"
  25. echo "Upstream is $COUNT commits ahead"
  26. - name: Merge upstream
  27. if: steps.check.outputs.count != '0'
  28. id: merge
  29. run: |
  30. git config user.name "github-actions[bot]"
  31. git config user.email "github-actions[bot]@users.noreply.github.com"
  32. git merge upstream/master --no-edit
  33. continue-on-error: true
  34. - name: Push if merge succeeded
  35. if: steps.check.outputs.count != '0' && steps.merge.outcome == 'success'
  36. run: git push origin master
  37. - name: Create issue on conflict
  38. if: steps.merge.outcome == 'failure'
  39. uses: actions/github-script@v7
  40. with:
  41. script: |
  42. await github.rest.issues.create({
  43. owner: context.repo.owner,
  44. repo: context.repo.repo,
  45. title: 'Upstream sync failed — merge conflict',
  46. body: 'Automatic merge from `9seconds/mtg:master` failed due to conflicts.\n\nResolve manually:\n```\ngit fetch upstream\ngit merge upstream/master\n# fix conflicts\ngit push origin master\n```',
  47. labels: ['sync']
  48. });