2023-04-04 14:49:06 +00:00
|
|
|
name: Update weekly branch
|
2023-04-03 22:12:51 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
schedule:
|
2023-04-04 14:49:06 +00:00
|
|
|
# At 14:20 UTC on Saturday
|
|
|
|
- cron: "20 14 * * 6"
|
2023-04-03 22:12:51 +00:00
|
|
|
|
|
|
|
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
|