Skip to content

Commit

Permalink
skip build and push for private packages
Browse files Browse the repository at this point in the history
Signed-off-by: Manuel Ruck <[email protected]>
  • Loading branch information
Manuel Ruck committed Oct 8, 2023
1 parent 8e5f648 commit b6fb316
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/build-and-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,14 @@ jobs:
turboChanges=$(turbo run build --dry-run=json --since=${{ env.SINCE }})
changedPackages=$(node -e "const results = $turboChanges.tasks.map((task) => ({ package: task.package, directory: task.directory })); process.stdout.write(JSON.stringify(results));")
echo "$changedPackages"
changedPackagesFiltered=$(node -e "const fs = require('fs'); const results = $changedPackages.filter(({directory}) => {const private = JSON.parse(fs.readFileSync(\`./\${directory}/package.json\`, 'utf8')).private; return private === false || private === undefined;}); process.stdout.write(JSON.stringify(results));")
echo "$changedPackagesFiltered"
echo "changedPackages=$changedPackages" >> $GITHUB_OUTPUT
changed=$(node -e "const results = $changedPackages.map(({package}) => package); process.stdout.write(JSON.stringify(results));")
changed=$(node -e "const results = $changedPackagesFiltered.map(({package}) => package); process.stdout.write(JSON.stringify(results));")
echo "changed=$changed" >> $GITHUB_OUTPUT
- run: echo ${{ steps.changed-packages.outputs.changed }}
- name: Print Changed Packages
run: echo ${{ steps.changed-packages.outputs.changed }}

push:
runs-on: ubuntu-latest
Expand Down

0 comments on commit b6fb316

Please sign in to comment.