Skip to content

Commit

Permalink
Merge pull request #9 from eclipse-tractusx/fix/api_publish_workflow
Browse files Browse the repository at this point in the history
fix: api publish workflow
  • Loading branch information
tomaszbarwicki authored Jul 4, 2024
2 parents 535c1b3 + 670b630 commit ae6073c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/publish_api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ on:
- cron: "0 4 * * *"

env:
# API collector and specs download "docs" path
API_COLLECTOR_DIR: "src/api-collector"

jobs:
Expand All @@ -47,7 +48,7 @@ jobs:
- name: Check for specs
id: check_specs
run: |
if [ -d "docs" ]; then
if [ -d "${{ env.API_COLLECTOR_DIR }}/docs" ]; then
echo "exists=true" >> $GITHUB_OUTPUT
else
echo "exists=false" >> $GITHUB_OUTPUT
Expand All @@ -56,7 +57,7 @@ jobs:
if: steps.check_specs.outputs.exists == 'true'
with:
name: openapi-${{ steps.collect_specs.outputs.RANDOM }}
path: docs
path: ${{ env.API_COLLECTOR_DIR }}/docs
generate_matrix:
runs-on: ubuntu-latest
needs: collect_openapi
Expand All @@ -83,6 +84,12 @@ jobs:
matrix: ${{ fromJson(needs.generate_matrix.outputs.specs) }}
steps:
- uses: actions/checkout@v4
- name: Download OpenAPI specs artifacts
uses: actions/download-artifact@v4
with:
path: docs
pattern: openapi-*
merge-multiple: true
- name: Determine spec file directory
id: determine_directory
run: |
Expand Down
4 changes: 2 additions & 2 deletions src/api-collector/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ func main() {

downloadedSpecs := downloadAPISpecs(*repo.Name, specsUrls)
log.Println("List of downloaded OpenAPI specs:")
for downloadedSpec := range downloadedSpecs {
log.Println("- ",downloadedSpec)
for _, downloadedSpec := range downloadedSpecs {
log.Printf("- %s\n",downloadedSpec)
}
}
}
Expand Down

0 comments on commit ae6073c

Please sign in to comment.