Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions .github/workflows/regenerate-connector-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,22 @@ jobs:
echo "Unsupported file extension: ${{ inputs.openapi-url }}"
exit 1
fi

- name: Read File Extension
working-directory: docs/spec
run: |
file=$(echo openapi.*)
ext="${file##*.}"
echo "EXTENSION=$ext" >> "$GITHUB_ENV"

- name: Checkout or Create Branch
run: |
if git show-ref --verify --quiet refs/heads/regenerate-connector; then
git checkout regenerate-connector
else
git checkout -b regenerate-connector
fi

- name: Flatten OpenAPI Specification
if: ${{ inputs.flatten-openapi }}
working-directory: docs/spec
Expand Down Expand Up @@ -169,11 +177,9 @@ jobs:
- name: Commit Files
id: commitFiles
run: |
git checkout -b regenerate-connector

changed=false
# First commit: OpenAPI spec changes
git add docs/spec/
git add docs/spec/
if ! git diff --cached --quiet; then
git commit -m "[AUTOMATED] Update OpenAPI spec"
changed=true
Expand Down
2 changes: 0 additions & 2 deletions regenerate-openapi-connectors/main.bal
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ public function main() returns error? {
printError(modules);
return modules;
}
modules.forEach((m) => io:println(m.name));
ProcessingModule[] processingModules = [];
if modules.length() == 0 {
return;
Expand Down Expand Up @@ -141,7 +140,6 @@ isolated function triggerModuleRegeneration(Module m) returns int|error {
if branchResult is github:BranchWithProtection {
string message = string `Branch ${REGENERATION_BRANCH} already exists for module: ${m.name}`;
printInfo(message);
return error(message);
}

error? dispatchResult = github->/repos/[GITHUB_ORG]/[m.name]/actions/workflows/[workflow]/dispatches.post(payload);
Expand Down