File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,11 +35,30 @@ jobs:
3535 perl ./list.pl | cut -d/ -f2 | sort > list.pl.out
3636 diff ls.out list.pl.out
3737
38+ dfhack-ref :
39+ runs-on : ubuntu-latest
40+ outputs :
41+ ref : ${{ steps.resolve.outputs.ref }}
42+ steps :
43+ - id : resolve
44+ env :
45+ REPO : ${{ format('{0}/dfhack', github.event_name == 'push' && github.repository_owner || github.event.pull_request.base.repo.owner.login) }}
46+ BRANCH : ${{ github.base_ref || github.ref_name }}
47+ run : |
48+ ref="$BRANCH"
49+ [ "$ref" = master ] && ref=develop
50+ if [ "$ref" != develop ] && ! git ls-remote --exit-code --heads "https://github.com/$REPO" "$ref" >/dev/null 2>&1; then
51+ echo "no '$ref' branch in $REPO; falling back to develop"
52+ ref=develop
53+ fi
54+ echo "ref=$ref" >> "$GITHUB_OUTPUT"
55+
3856 test :
57+ needs : dfhack-ref
3958 uses : DFHack/dfhack/.github/workflows/test.yml@develop
4059 with :
4160 dfhack_repo : ${{ format('{0}/dfhack', github.event_name == 'push' && github.repository_owner || github.event.pull_request.base.repo.owner.login) }}
42- dfhack_ref : ${{ (((github.base_ref || github.ref_name) == 'master') && 'develop' || (github.base_ref || github.ref_name)) }}
61+ dfhack_ref : ${{ needs.dfhack-ref.outputs.ref }}
4362 structures_repo : ${{ github.repository }}
4463 structures_ref : ${{ github.ref }}
4564 secrets : inherit
You can’t perform that action at this time.
0 commit comments