ytdl-nightly/.github/workflows/rebase-on-upstream.yml

42 lines
1.1 KiB
YAML

name: Rebase on Upstream
on:
schedule:
- cron: '53 0 * * *'
workflow_dispatch:
jobs:
rebase:
runs-on: ubuntu-latest
outputs:
build-commit: ${{ steps.relocate.outputs.build-commit }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.GH_PAT }}
- name: Locate
shell: bash
run: |
echo "HEAD_NOW=$(git rev-parse HEAD)" >> "$GITHUB_ENV"
- name: Rebase
# fetches upstream as git remote `upstream`
uses: ytdl-org/reverse-rebase-upstream-action@master
with:
token: ${{ secrets.GH_PAT }}
upstream: ytdl-org/youtube-dl
- name: Relocate
id: relocate
shell: bash
run: |
NEW_HEAD=$(git rev-parse HEAD)
[ "${{ env.HEAD_NOW }}" = "$NEW_HEAD" ] || echo "build-commit=$(git rev-parse upstream/master)" >> "$GITHUB_OUTPUT"
build:
needs: rebase
if: ${{ needs.rebase.outputs.build-commit }}
uses: ./.github/workflows/build.yml
with:
build-commit: ${{ needs.rebase.outputs.build-commit }}