2022-02-13 08:41:06 +01:00
|
|
|
name: Rebase on Upstream
|
|
|
|
|
|
|
|
on:
|
|
|
|
schedule:
|
2023-07-14 04:44:45 +02:00
|
|
|
- cron: '53 0 * * *'
|
2022-02-13 08:41:06 +01:00
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
rebase:
|
|
|
|
runs-on: ubuntu-latest
|
2023-07-14 04:44:45 +02:00
|
|
|
outputs:
|
|
|
|
build-commit: ${{ steps.relocate.outputs.build-commit }}
|
2022-02-13 08:41:06 +01:00
|
|
|
steps:
|
2023-07-14 04:44:45 +02:00
|
|
|
- name: Checkout
|
2023-09-10 21:16:55 +02:00
|
|
|
uses: actions/checkout@v3
|
2022-02-13 08:41:06 +01:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2023-07-02 14:26:27 +02:00
|
|
|
token: ${{ secrets.GH_PAT }}
|
2023-07-14 04:44:45 +02:00
|
|
|
- name: Locate
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
echo "HEAD_NOW=$(git rev-parse HEAD)" >> "$GITHUB_ENV"
|
|
|
|
- name: Rebase
|
2023-07-23 22:14:41 +02:00
|
|
|
# fetches upstream as git remote `upstream`
|
2023-09-22 02:24:55 +02:00
|
|
|
uses: ytdl-org/reverse-rebase-upstream-action@master
|
2022-02-13 08:41:06 +01:00
|
|
|
with:
|
|
|
|
token: ${{ secrets.GH_PAT }}
|
2023-07-02 14:26:27 +02:00
|
|
|
upstream: ytdl-org/youtube-dl
|
2023-07-14 04:44:45 +02:00
|
|
|
- name: Relocate
|
|
|
|
id: relocate
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
NEW_HEAD=$(git rev-parse HEAD)
|
2023-07-23 22:14:41 +02:00
|
|
|
[ "${{ env.HEAD_NOW }}" = "$NEW_HEAD" ] || echo "build-commit=$(git rev-parse upstream/master)" >> "$GITHUB_OUTPUT"
|
2023-07-14 04:44:45 +02:00
|
|
|
|
|
|
|
build:
|
|
|
|
needs: rebase
|
|
|
|
if: ${{ needs.rebase.outputs.build-commit }}
|
|
|
|
uses: ./.github/workflows/build.yml
|
|
|
|
with:
|
|
|
|
build-commit: ${{ needs.rebase.outputs.build-commit }}
|