Skip to content

Commit

Permalink
Update packages only once per PR
Browse files Browse the repository at this point in the history
  • Loading branch information
andonyns committed Nov 14, 2023
1 parent 48fb2a2 commit 5525b74
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/on-merge-to-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ jobs:
runs-on: ubuntu-latest
defaults:
run:
shell: pwsh
working-directory: Meadowlark-js
steps:
- name: Checkout the Repo
Expand All @@ -33,6 +32,7 @@ jobs:
echo "version=$version" >> "$GITHUB_OUTPUT"
- name: Create Meadowlark Pre-Release
shell: pwsh
run: |
$version="${{steps.set-version.outputs.version}}"
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/on-pullrequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,18 +126,26 @@ jobs:
- name: Checkout the Repo
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with:
fetch-depth: 0w
ref: ${{ github.event.pull_request.head.ref }}

- name: Get changes
id: changes
run: echo "changes=$(git diff --name-only -r origin/main HEAD -- '*lerna.json')" >>$GITHUB_OUTPUT

- name: Update versions
if: ${{ ! steps.changes.outputs.changes }}
run: npx [email protected] version prerelease --exact --no-git-tag-version --yes

- name: Set Version
if: ${{ ! steps.changes.outputs.changes }}
id: set-version
run: |
version=v$(cat lerna.json | jq -r .version)
echo "version=$version" >> "$GITHUB_OUTPUT"
- uses: planetscale/[email protected]
if: ${{ ! steps.changes.outputs.changes }}
with:
commit_message: "${{steps.set-version.outputs.version}}"
repo: ${{ github.repository }}
Expand Down

0 comments on commit 5525b74

Please sign in to comment.