Skip to content

Commit 2c1f3a4

Browse files
Main simplify release (#85)
* get full git history first * remove deprecated auth warning * use pnpm publish instead of npm * @instructure.ai/shared-configs@1.1.3 * lint * @instructure.ai/shared-configs@1.1.4 * Update .github/workflows/release-package.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update .github/workflows/release-package.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * update build script * properly invoke custom build script * simplify release script * exit early when no change in ./apps * easier PR prefix validation * use fetch-depth: 0 * robust git dif --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent c5a940f commit 2c1f3a4

File tree

2 files changed

+23
-5
lines changed

2 files changed

+23
-5
lines changed

.github/workflows/deploy-apps.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,22 @@ jobs:
2323
steps:
2424
- name: Checkout
2525
uses: actions/checkout@v4
26+
with:
27+
fetch-depth: 0
2628

2729
- name: Exit if no changes in ./apps
2830
shell: bash
2931
run: |
30-
if ! git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep '^apps/'; then
31-
echo "No changes in ./apps directory."
32+
BEFORE_SHA="${{ github.event.before }}"
33+
AFTER_SHA="${{ github.sha }}"
34+
# Try diffing with BEFORE_SHA, fallback to HEAD~1 if not available
35+
if git cat-file -e "$BEFORE_SHA" 2>/dev/null; then
36+
DIFF_RANGE="$BEFORE_SHA $AFTER_SHA"
37+
else
38+
DIFF_RANGE="HEAD~1 HEAD"
39+
fi
40+
if ! git diff --name-only $DIFF_RANGE | grep '^apps/'; then
41+
echo "No changes in ./apps directory. Exiting early."
3242
exit 0
3343
fi
3444
- name: Set up Node

.github/workflows/tag-on-merge.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,25 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
1517
- name: Set up Git user
1618
run: |
1719
git config user.name "github-actions[bot]"
1820
git config user.email "github-actions[bot]@users.noreply.github.com"
19-
- name: Fetch full git history
20-
run: git fetch --unshallow || git fetch --all
2121
- name: Retag all changed packages
2222
env:
2323
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2424
run: |
25-
for pkgjson in $(git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -E '^(package.json|packages/.*/package.json)$'); do
25+
BEFORE_SHA="${{ github.event.before }}"
26+
AFTER_SHA="${{ github.sha }}"
27+
# Try diffing with BEFORE_SHA, fallback to HEAD~1 if not available
28+
if git cat-file -e "$BEFORE_SHA" 2>/dev/null; then
29+
DIFF_RANGE="$BEFORE_SHA $AFTER_SHA"
30+
else
31+
DIFF_RANGE="HEAD~1 HEAD"
32+
fi
33+
for pkgjson in $(git diff --name-only $DIFF_RANGE | grep -E '^(package.json|packages/.*/package.json)$'); do
2634
NAME=$(jq -r .name $pkgjson)
2735
VERSION=$(jq -r .version $pkgjson)
2836
TAG="${NAME}@${VERSION}"

0 commit comments

Comments
 (0)