diff --git a/.github/workflows/if-nodejs-release.yml b/.github/workflows/if-nodejs-release.yml index 19db26d33..60cd10345 100644 --- a/.github/workflows/if-nodejs-release.yml +++ b/.github/workflows/if-nodejs-release.yml @@ -1,15 +1,15 @@ # This action is centrally managed in https://github.com/asyncapi/.github/ -# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo +# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in the above-mentioned repo -# It does magic only if there is package.json file in the root of the project +# It does magic only if there is a package.json file in the root of the project name: Release - if Node project on: push: branches: - master - # below lines are not enough to have release supported for these branches - # make sure configuration of `semantic-release` package mentions these branches + # The below lines are not enough to have release supported for these branches + # Make sure the configuration of the `semantic-release` package mentions these branches - next-spec - next-major - next-major-spec @@ -18,17 +18,16 @@ on: - next jobs: - test-nodejs: - # We just check the message of first commit as there is always just one commit because we squash into one before merging - # "commits" contains array of objects where one of the properties is commit "message" + # We just check the message of the first commit as there is always just one commit because we squash into one before merging + # "commits" contains an array of objects where one of the properties is the commit "message" # Release workflow will be skipped if release conventional commits are not used if: | - startsWith( github.repository, 'asyncapi/' ) && - (startsWith( github.event.commits[0].message , 'fix:' ) || - startsWith( github.event.commits[0].message, 'fix!:' ) || - startsWith( github.event.commits[0].message, 'feat:' ) || - startsWith( github.event.commits[0].message, 'feat!:' )) + startsWith(github.repository, 'asyncapi/') && + (startsWith(github.event.commits[0].message, 'fix:') || + startsWith(github.event.commits[0].message, 'fix!:') || + startsWith(github.event.commits[0].message, 'feat:') || + startsWith(github.event.commits[0].message, 'feat!:')) name: Test NodeJS release on ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: @@ -37,7 +36,7 @@ jobs: # See: https://github.com/puppeteer/puppeteer/issues/12327 and https://github.com/asyncapi/parser-js/issues/1001 os: [ubuntu-latest, macos-13, windows-latest] steps: - - name: Set git to use LF #to once and for all finish neverending fight between Unix and Windows + - name: Set git to use LF # To once and for all finish the never-ending fight between Unix and Windows run: | git config --global core.autocrlf false git config --global core.eol lf @@ -60,7 +59,7 @@ jobs: - if: steps.lockversion.outputs.version == '18' && matrix.os == 'windows-latest' name: Install npm cli 8 shell: bash - #npm cli 10 is buggy because of some cache issues + # npm cli 10 is buggy because of some cache issues run: npm install -g npm@8.19.4 - if: steps.packagejson.outputs.exists == 'true' name: Install dependencies @@ -69,22 +68,22 @@ jobs: - if: steps.packagejson.outputs.exists == 'true' name: Run test run: npm test --if-present - - if: failure() # Only, on failure, send a message on the 94_bot-failing-ci slack channel + - if: failure() # Only, on failure, send a message on the 94_bot-failing-ci Slack channel name: Report workflow run status to Slack uses: 8398a7/action-slack@v3 with: status: ${{ job.status }} fields: repo,action,workflow - text: 'Release workflow failed in testing job' + text: "Release workflow failed in testing job" env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_FAIL_NOTIFY }} release: needs: [test-nodejs] - name: Publish to any of NPM, Github, or Docker Hub + name: Publish to any of NPM, GitHub, or Docker Hub runs-on: ubuntu-latest steps: - - name: Set git to use LF #to once and for all finish neverending fight between Unix and Windows + - name: Set git to use LF # To once and for all finish the never-ending fight between Unix and Windows run: | git config --global core.autocrlf false git config --global core.eol lf @@ -107,7 +106,7 @@ jobs: name: Install dependencies shell: bash run: npm ci - - if: steps.packagejson.outputs.exists == 'true' + - if: steps.packagejson.outputs.exists == 'true' name: Create Release Pull Request or Release uses: changesets/action@v1 - if: steps.packagejson.outputs.exists == 'true' @@ -127,7 +126,7 @@ jobs: GIT_AUTHOR_EMAIL: info@asyncapi.io GIT_COMMITTER_NAME: asyncapi-bot GIT_COMMITTER_EMAIL: info@asyncapi.io - - if: failure() # Only, on failure, send a message on the 94_bot-failing-ci slack channel + - if: failure() # Only, on failure, send a message on the 94_bot-failing-ci Slack channel name: Report workflow run status to Slack uses: 8398a7/action-slack@v3 with: