7070 with :
7171 spec-link : https://developers.phoenixnap.com/portals/api/sites/phoenixnap-prod-developerportal/liveportal/apis/bmc-location/download_spec
7272 package-name : pnap_location_api
73-
73+ generate-invoicingapi :
74+ needs : prerequisite
75+ uses : ./.github/workflows/_generate.yml
76+ with :
77+ spec-link : https://developers.phoenixnap.com/portals/api/sites/phoenixnap-prod-developerportal/liveportal/apis/invoicing/download_spec
78+ package-name : pnap_invoicing_api
79+ generate-paymentsapi :
80+ needs : prerequisite
81+ uses : ./.github/workflows/_generate.yml
82+ with :
83+ spec-link : https://developers.phoenixnap.com/portals/api/sites/phoenixnap-prod-developerportal/liveportal/apis/payments/download_spec
84+ package-name : pnap_payments_api
85+
7486 # Push generated code
7587 push-changes :
7688 name : Push Changes
@@ -84,23 +96,52 @@ jobs:
8496 - generate-tagapi
8597 - generate-networkstorageapi
8698 - generate-locationapi
99+ - generate-invoicingapi
100+ - generate-paymentsapi
101+ outputs :
102+ CHANGES_FOUND : ${{ steps.commit-step.outputs.CHANGES_FOUND }}
87103 steps :
88104 - name : Check out the repo
89105 uses : actions/checkout@v3
106+ - name : Clean up modules
107+ run : |
108+ rm -rf ./pnap_audit_api \
109+ ./pnap_bmc_api \
110+ ./pnap_ip_api \
111+ ./pnap_location_api \
112+ ./pnap_network_api \
113+ ./pnap_network_storage_api \
114+ ./pnap_rancher_solution_api \
115+ ./pnap_tag_api \
116+ ./pnap_payment_api \
117+ ./pnap_invoice_api
90118 - name : Download Artifacts
91119 uses : actions/download-artifact@v3
92120 - name : Move spec files
93121 run : |
94122 find . -type f -name "*.spec.yaml" -not -path "./specs/*" -print0 | xargs -0 mv -ft ./specs/
95- - name : Add and Commit files
123+ - id : commit-step
124+ name : Add and Commit files
96125 run : |
97126 git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
98127 git config --local user.name "github-actions[bot]"
99128 git add -A
100129
101- if test "$(git status --porcelain=v1 2>/dev/null | wc -l)" -gt "0" ; then git commit -m "Add changes"; else echo No changes found; fi
130+ if test "$(git status --porcelain=v1 2>/dev/null | wc -l)" -gt "0" ;
131+ then
132+ git commit -m "Add changes";
133+ echo "CHANGES_FOUND=true" >> "$GITHUB_OUTPUT";
134+ else
135+ echo No changes found;
136+ fi
102137 - name : Push changes
103138 uses : ad-m/github-push-action@master
104139 with :
105140 github_token : ${{ secrets.GITHUB_TOKEN }}
106- branch : ${{ github.ref }}
141+ branch : ${{ github.ref }}
142+
143+ validate-all :
144+ if : ${{ needs.push-changes.outputs.CHANGES_FOUND }}
145+ needs :
146+ - push-changes
147+ uses : ./.github/workflows/validate-all.yml
0 commit comments