Automatically merge new changes once a day

This commit is contained in:
TSR Berry 2023-04-04 00:12:51 +02:00
parent 221401b3c6
commit 4026898155
No known key found for this signature in database
GPG key ID: 52353C0A4CCA15E2
3 changed files with 44 additions and 2 deletions

View file

@ -2,7 +2,6 @@ name: Release job
on:
workflow_dispatch:
inputs: {}
push:
branches: [ stable ]
paths-ignore:

View file

@ -2,7 +2,6 @@ name: Release staging build
on:
workflow_dispatch:
inputs: {}
push:
branches: [ master ]
paths-ignore:

44
.github/workflows/update_stable.yml vendored Normal file
View file

@ -0,0 +1,44 @@
name: Update stable branch
on:
workflow_dispatch:
schedule:
# Daily at 14:20 UTC
- cron: "20 14 * * *"
jobs:
update_stable:
runs-on: ubuntu-latest
env:
GIT_COMMITTER_NAME: "RyujinxBot"
GIT_COMMITTER_EMAIL: "61127645+RyujinxBot@users.noreply.github.com"
steps:
- uses: actions/checkout@v3
with:
ref: stable
fetch-depth: 0
token: ${{ secrets.RYUJINX_BOT_PAT }}
- name: Get version info
id: version_info
run: |
echo "git_hash=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
- name: Check for changes
id: check
run: |
echo "no_changes="gh api /repos/$REPO/commits/$COMMIT/branches-where-head --jq 'any(.name == "master")' >> $GITHUB_OUTPUT
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
COMMIT: ${{ steps.version_info.outputs.git_hash }}
- name: Merge changes from master
if: steps.check.outputs.no_changes == 'false'
run: |
git config user.name "${{ env.GIT_COMMITTER_NAME }}"
git config user.email "${{ env.GIT_COMMITTER_EMAIL }}"
git merge origin/master
git push