JS: fix npmPublish skip detection that always reported "already published" #23160
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| name: ci | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags-ignore: | |
| - "*" | |
| pull_request: | |
| branches: | |
| - main | |
| workflow_dispatch: {} | |
| schedule: | |
| - cron: 0 16 * * * | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| if: github.event_name != 'schedule' || github.repository_owner == 'openrewrite' || github.repository_owner == 'moderneinc' | |
| steps: | |
| - uses: openrewrite/gh-automation/.github/actions/setup@main | |
| with: | |
| java_version: | | |
| 25 | |
| 21 | |
| develocity_access_key: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} | |
| # Route Maven resolution through Moderne's Artifactory cache to avoid | |
| # Maven Central rate-limiting (HTTP 404 + Retry-After) under parallel | |
| # test load. Picked up by MavenSettingsAutoLoadingExtension at test time. | |
| - uses: s4u/maven-settings-action@v3.1.0 | |
| with: | |
| mirrors: '[{"id": "moderne-cache", "name": "Moderne Artifactory Cache", "mirrorOf": "*", "url": "https://artifactory.moderne.ninja/artifactory/moderne-cache-3/"}]' | |
| servers: '[{"id": "moderne-cache", "username": "${{ secrets.ARTIFACTORY_USERNAME }}", "password": "${{ secrets.ARTIFACTORY_PASSWORD }}"}]' | |
| - uses: openrewrite/gh-automation/.github/actions/build@main | |
| env: | |
| REWRITE_GRADLE_MIRROR_URL: https://artifactory.moderne.ninja/artifactory/moderne-cache-3/ | |
| REWRITE_GRADLE_MIRROR_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }} | |
| REWRITE_GRADLE_MIRROR_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }} | |
| - if: failure() && github.event_name == 'schedule' && (github.repository_owner == 'openrewrite' || github.repository_owner == 'moderneinc') | |
| uses: openrewrite/gh-automation/.github/actions/slack-failure@main | |
| with: | |
| webhook: ${{ secrets.OPS_GITHUB_ACTIONS_WEBHOOK }} | |
| - if: > | |
| github.event_name != 'pull_request' && | |
| github.ref == 'refs/heads/main' && | |
| (github.repository_owner == 'openrewrite' || github.repository_owner == 'moderneinc') | |
| uses: openrewrite/gh-automation/.github/actions/publish-snapshots@main | |
| with: | |
| sonatype_username: ${{ secrets.SONATYPE_USERNAME }} | |
| sonatype_token: ${{ secrets.SONATYPE_TOKEN }} | |
| ossrh_signing_key: ${{ secrets.OSSRH_SIGNING_KEY }} | |
| ossrh_signing_password: ${{ secrets.OSSRH_SIGNING_PASSWORD }} | |
| node_auth_token: ${{ secrets.NPM_TOKEN }} | |
| pypi_token: ${{ secrets.PYPI_OPENREWRITE_PUBLISH }} | |
| nuget_api_key: ${{ secrets.NUGET_API_KEY }} |