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

42 lines
1.1 KiB
YAML
Raw Normal View History

2022-02-13 08:41:06 +01:00
name: Rebase on Upstream
on:
schedule:
- cron: '53 0 * * *'
2022-02-13 08:41:06 +01:00
workflow_dispatch:
jobs:
rebase:
runs-on: ubuntu-latest
outputs:
build-commit: ${{ steps.relocate.outputs.build-commit }}
2022-02-13 08:41:06 +01:00
steps:
- name: Checkout
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 }}
- 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
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
- 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 }}