File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 7676 needs : test
7777 if : github.ref == 'refs/heads/master'
7878 runs-on : ubuntu-latest
79+ outputs :
80+ has_changes : ${{ steps.check_changes.outputs.has_changes }}
7981 steps :
8082 - name : Checkout code
8183 uses : actions/checkout@v4
@@ -103,17 +105,26 @@ jobs:
103105 run : echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" > ~/.npmrc
104106
105107 - name : List changed packages
108+ id : check_changes
106109 run : |
107110 echo "### Following pending deployments found" >> $GITHUB_STEP_SUMMARY
108111 yarn lerna exec --loglevel silent --concurrency 1 -- \
109112 'VERSION=$(node -p "require(\"./package.json\").version"); \
110113 if [ "$(npm view $LERNA_PACKAGE_NAME version --registry=https://npm.pkg.github.com/ 2>/dev/null || echo "0.0.0")" != "$VERSION" ]; then \
111114 echo "- **$LERNA_PACKAGE_NAME** - will publish version $VERSION" >> $GITHUB_STEP_SUMMARY; \
115+ echo "true" > $GITHUB_WORKSPACE/.has_changes; \
112116 fi'
117+ if [ -f $GITHUB_WORKSPACE/.has_changes ]; then
118+ echo "has_changes=true" >> $GITHUB_OUTPUT
119+ rm $GITHUB_WORKSPACE/.has_changes
120+ else
121+ echo "has_changes=false" >> $GITHUB_OUTPUT
122+ echo "- None" >> $GITHUB_STEP_SUMMARY
123+ fi
113124
114125 publish :
115126 needs : prepare-publish
116- if : github.ref == 'refs/heads/master'
127+ if : github.ref == 'refs/heads/master' && needs.prepare-publish.outputs.has_changes == 'true'
117128 runs-on : ubuntu-latest
118129 environment :
119130 name : github-npm-registry
You can’t perform that action at this time.
0 commit comments