-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'ka.externalApiVersioning' into tim/external-api-version…
…ing-test # Conflicts: # .github/workflows/Versioning.yml
- Loading branch information
Showing
1 changed file
with
19 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,30 +35,35 @@ jobs: | |
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.pull_request.head.ref }} | ||
|
||
- uses: ./.github/actions/setup | ||
with: | ||
node-version: 20 | ||
|
||
- name: Bump external API version if necessary | ||
run: pnpm -F commonwealth validate-external-api-version | ||
|
||
- name: Get changed version files | ||
id: changed-files-specific | ||
uses: tj-actions/changed-files@v35 | ||
with: | ||
files: | | ||
packages/commonwealth/server/external-api-config.json | ||
- name: Check if version was updated | ||
run: | | ||
if git diff --name-only | grep -q packages/commonwealth/server/external-api-config.json; then | ||
echo "version_updated=true" >> $GITHUB_ENV | ||
else | ||
echo "version_updated=false" >> $GITHUB_ENV | ||
fi | ||
- name: Format updated files | ||
if: steps.changed-files-specific.outputs.any_changed == 'true' | ||
if: env.version_updated == 'true' | ||
run: pnpm dlx prettier --write ./packages/commonwealth/server/external-api-config.json | ||
|
||
- name: Commit and push updated files | ||
if: steps.changed-files-specific.outputs.any_changed == 'true' | ||
run: | | ||
git config --global user.name "timolegros" | ||
git config --global user.email "[email protected]" | ||
git add packages/commonwealth/server/external-api-config.json | ||
git diff --cached --exit-code || git commit -m "chore: update client SDK version" && git push origin HEAD | ||
- name: Commit and Push | ||
if: env.version_updated == 'true' | ||
uses: EndBug/add-and-commit@v9 | ||
with: | ||
add: 'packages/commonwealth/server/external-api-config.json' | ||
push: true | ||
|
||
# May need to add a `repo` scoped personal access token | ||
# if we want to run checks for this new push | ||
# https://github.com/peter-evans/create-pull-request/issues/48#issuecomment-536204092 | ||
|