Skip to content

Commit eba9d18

Browse files
authored
fix: status checks contexts (#2)
1 parent c831a83 commit eba9d18

File tree

1 file changed

+3
-19
lines changed

1 file changed

+3
-19
lines changed

entrypoint.sh

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -160,22 +160,14 @@ for repository in "${REPOSITORIES[@]}"; do
160160
-u ${USERNAME}:${GITHUB_TOKEN} \
161161
--silent \
162162
${GITHUB_API_URL}/repos/${repository}/branches/${BRANCH_PROTECTION_NAME}/protection
163-
164-
curl -L \
165-
-X POST \
166-
-H "Accept: application/vnd.github+json" \
167-
-u ${USERNAME}:${GITHUB_TOKEN} \
168-
-H "X-GitHub-Api-Version: 2022-11-28" \
169-
--silent \
170-
https://api.github.com/repos/${repository}/branches/${BRANCH_PROTECTION_NAME}/protection/enforce_admins
171163

172164
curl -L \
173165
-X PATCH \
174166
-H "Accept: application/vnd.github+json" \
175167
-u ${USERNAME}:${GITHUB_TOKEN}\
176168
-H "X-GitHub-Api-Version: 2022-11-28" \
177-
https://api.github.com/repos/${repository}/branches/${BRANCH_PROTECTION_NAME}/protection/required_status_checks \
178-
-d '{"strict":true}'
169+
${GITHUB_API_URL}/repos/${repository}/branches/${BRANCH_PROTECTION_NAME}/protection/required_status_checks \
170+
-d '{"strict":true, "checks": [{"context": "", "app_id": -1}]}'
179171

180172
elif [ "$BRANCH_PROTECTION_ENABLED" == "false" ]; then
181173
curl \
@@ -186,20 +178,12 @@ for repository in "${REPOSITORIES[@]}"; do
186178
--silent \
187179
${GITHUB_API_URL}/repos/${repository}/branches/${BRANCH_PROTECTION_NAME}/protection
188180

189-
curl -L \
190-
-X DELETE \
191-
-H "Accept: application/vnd.github+json" \
192-
-u ${USERNAME}:${GITHUB_TOKEN} \
193-
-H "X-GitHub-Api-Version: 2022-11-28" \
194-
--silent \
195-
https://api.github.com/repos/${repository}/branches/${BRANCH_PROTECTION_NAME}/protection/enforce_admins
196-
197181
curl -L \
198182
-X DELETE \
199183
-H "Accept: application/vnd.github+json" \
200184
-u ${USERNAME}:${GITHUB_TOKEN}\
201185
-H "X-GitHub-Api-Version: 2022-11-28" \
202-
https://api.github.com/repos/${repository}/branches/${BRANCH_PROTECTION_NAME}/protection/required_status_checks
186+
${GITHUB_API_URL}/repos/${repository}/branches/${BRANCH_PROTECTION_NAME}/protection/required_status_checks
203187

204188
fi
205189

0 commit comments

Comments
 (0)