Skip to content

Commit d845536

Browse files
sherifnadagl-pix
authored andcommitted
Periodic connector tests workflow: add Accept header per github docs recommendation (#4722)
1 parent 8e11a09 commit d845536

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

tools/bin/ci_integration_workflow_launcher.sh

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,37 @@ set -e
44

55
# launches integration test workflows for master builds
66

7-
if [[ -z "$GITHUB_TOKEN" ]] ; then
7+
if [[ -z "$GITHUB_TOKEN" ]]; then
88
echo "GITHUB_TOKEN not set..."
99
exit 1
1010
fi
1111

1212
REPO_API=https://api.github.com/repos/airbytehq/airbyte
1313
WORKFLOW_PATH=.github/workflows/test-command.yml
1414
WORKFLOW_ID=$(curl --header "Authorization: Bearer $GITHUB_TOKEN" "$REPO_API/actions/workflows" | jq -r ".workflows[] | select( .path == \"$WORKFLOW_PATH\" ) | .id")
15-
MATCHING_WORKFLOW_IDS=$(wc -l <<< "${WORKFLOW_ID}")
15+
MATCHING_WORKFLOW_IDS=$(wc -l <<<"${WORKFLOW_ID}")
1616

17-
if [ "$MATCHING_WORKFLOW_IDS" -ne "1" ] ; then
17+
if [ "$MATCHING_WORKFLOW_IDS" -ne "1" ]; then
1818
echo "More than one workflow exists with the path $WORKFLOW_PATH"
1919
exit 1
2020
fi
2121

2222
MAX_RUNNING_MASTER_WORKFLOWS=5
2323
RUNNING_MASTER_WORKFLOWS=$(curl "$REPO_API/actions/workflows/$WORKFLOW_ID/runs?branch=master&status=in_progress" --header "Authorization: Bearer $GITHUB_TOKEN" | jq -r ".total_count")
24-
if [ "$RUNNING_MASTER_WORKFLOWS" -gt "$MAX_RUNNING_MASTER_WORKFLOWS" ] ; then
24+
if [ "$RUNNING_MASTER_WORKFLOWS" -gt "$MAX_RUNNING_MASTER_WORKFLOWS" ]; then
2525
echo "More than $MAX_RUNNING_MASTER_WORKFLOWS integration tests workflows running on master."
2626
echo "Skipping launching workflows."
2727
exit 0
2828
fi
2929

3030
CONNECTORS=$(./gradlew integrationTest --dry-run | grep 'integrationTest SKIPPED' | cut -d: -f 4 | sort | uniq)
31-
echo "$CONNECTORS" | while read -r connector ; do
31+
echo "$CONNECTORS" | while read -r connector; do
3232
echo "Issuing request for connector $connector..."
3333
curl \
34+
-i \
3435
-X POST \
35-
--header "Authorization: Bearer $GITHUB_TOKEN" \
36+
-H "Accept: application/vnd.github.v3+json" \
37+
-H "Authorization: Bearer $GITHUB_TOKEN" \
3638
"$REPO_API/actions/workflows/$WORKFLOW_ID/dispatches" \
3739
-d "{\"ref\":\"master\", \"inputs\": { \"connector\": \"$connector\"} }"
3840
done

0 commit comments

Comments
 (0)