File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33 pull_request :
44 types : [opened, synchronize, reopened, edited]
55 branches : ['main']
6+ permissions :
7+ contents : read
68jobs :
79 # More info at https://github.com/Roave/BackwardCompatibilityCheck.
810 backwards-compatibility-check :
8890 echo "major version releases for those components"
8991 exit 1
9092 fi
93+
94+ # Ensure that if the release PR contains any NEW components, the new component's corresponding
95+ # sub-repo exists
96+ new-component-subrepo-check :
97+ name : New Component Sub-Repo Check
98+ runs-on : ubuntu-latest
99+ if : github.event.pull_request.user.login == 'release-please[bot]'
100+ steps :
101+ - uses : actions/checkout@v4
102+ with :
103+ fetch-depth : 0
104+ - name : " Check for unexpected major version"
105+ run : |
106+ COMPONENTS=$(git diff origin/main --name-only | grep VERSION | xargs dirname)
107+ FAIL=""
108+ for COMPONENT in ${COMPONENTS}; do {
109+ if [[ "$(cat $COMPONENT/VERSION)" == "0.1.0" ]]; then
110+ SUBREPO=$(cat $COMPONENT/composer.json | jq -r '.extra.component.target')
111+ echo "New component found: $COMPONENT"
112+ if curl --head --silent --fail "https://api.github.com/repos/$SUBREPO" -H 'Authorization: Bearer ${{secrets.GITHUB_TOKEN}}' > /dev/null; then
113+ echo " - Target Repo '$SUBREPO' exists"
114+ else
115+ echo " - Target Repo '$SUBREPO' DOES NOT EXIST"
116+ FAIL="true"
117+ fi
118+ fi
119+ }; done
120+ if [[ "$FAIL" == "true" ]]; then
121+ echo "Missing repositories for one or more new components"
122+ exit 1
123+ fi
You can’t perform that action at this time.
0 commit comments