From 77660d904820d2e632054a19ba1f1ec2ce36d5e5 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 22 Sep 2021 01:13:47 +0900 Subject: [PATCH] Update diffcalc action to checkout the correct upstream branch --- .github/workflows/diffcalc.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/diffcalc.yml b/.github/workflows/diffcalc.yml index 3c57d971ae..9e6d1c9f71 100644 --- a/.github/workflows/diffcalc.yml +++ b/.github/workflows/diffcalc.yml @@ -74,16 +74,23 @@ jobs: mkdir -p $GITHUB_WORKSPACE/master/ mkdir -p $GITHUB_WORKSPACE/pr/ + - name: Get upstream branch # https://akaimo.hatenablog.jp/entry/2020/05/16/101251 + id: upstreambranch + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + echo "::set-output name=branchname::$(curl -H "Authorization: token ${GITHUB_TOKEN}" ${{ github.event.issue.pull_request.url }} | jq '.head.ref' | sed 's/\"//g')" + # Checkout osu - name: Checkout osu (master) uses: actions/checkout@v2 with: - repository: ppy/osu path: 'master/osu' - name: Checkout osu (pr) uses: actions/checkout@v2 with: path: 'pr/osu' + ref: ${{ steps.upstreambranch.outputs.branchname }} - name: Checkout osu-difficulty-calculator (master) uses: actions/checkout@v2