-
Notifications
You must be signed in to change notification settings - Fork 22
41 lines (38 loc) · 1.06 KB
/
rebase-on-upstream.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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: ./.github/workflows/rebaser.yml
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 }}