File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515 runs-on : ubuntu-latest
1616
1717 steps :
18+ # a tagged main is already being published by the tag build of rector-src,
19+ # dispatching a second build would race it for the push to rectorphp/rector
20+ -
21+ name : " Check whether rector-src main is a release tag commit"
22+ id : release_tag
23+ run : |
24+ RECTOR_SRC="https://github.com/rectorphp/rector-src.git"
25+
26+ MAIN_SHA=$(git ls-remote $RECTOR_SRC refs/heads/main | cut -f1)
27+ if [ -z "$MAIN_SHA" ]; then
28+ echo "Could not resolve rector-src main"
29+ exit 1
30+ fi
31+
32+ # lightweight tags are listed with the commit itself, annotated ones with a "^{}" line
33+ if git ls-remote --tags $RECTOR_SRC | grep -q "^${MAIN_SHA}"; then
34+ echo "rector-src main $MAIN_SHA is tagged, leaving the build to the tag itself"
35+ echo "tagged=true" >> $GITHUB_OUTPUT
36+ fi
37+
1838 -
1939 name : " Trigger build_scoped_rector.yaml in rectorphp/rector-src"
40+ if : steps.release_tag.outputs.tagged != 'true'
2041 env :
2142 GH_TOKEN : ${{ secrets.ACCESS_TOKEN }}
2243 run : gh workflow run build_scoped_rector.yaml --repo rectorphp/rector-src --ref main
You can’t perform that action at this time.
0 commit comments