Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combination of --releaseAs=prerelease --skipCommit adds tags to orphan commit in GitHub Actions CI #650

Open
loliver opened this issue Feb 1, 2023 · 0 comments

Comments

@loliver
Copy link

loliver commented Feb 1, 2023

When running the following GHA step the plugin tags an orphan commit that is a direct descendent of --base with all of the changes from the PR. When running the same locally however, it tags the relevant commits on the correct branch where the changes were made.

Just the release step:

      - name: Version and publish
        run: npx nx affected ${{ fromJSON(steps.find-affected.outputs.affected).affectedMatrix }} --base=${{ fromJSON(steps.find-affected.outputs.affected).tagSha }} --target version --parallel=1 --trackDeps --skipCommit --releaseAs=prerelease --preid=alpha
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Full GHA job (with internal npm registry urls and secrets censored):

  alpharelease:
    needs: unittests
    name: Alpha releases
    runs-on: [self-hosted, oceanblue]
    steps:
      - name: Install node
        uses: actions/setup-node@v3
        with:
          node-version: '16'

      - name: Checkout repo
        uses: actions/checkout@v3
        with:
          fetch-depth: 0

      - name: Set .npmrc registries
        run: |
          printf "@oceanblue:registry=https:///internal.artifactory/artifactory/api/npm/anzx-npm/" >> .npmrc

      - name: Run npm install
        run: npm install
        env:
          PUPPETEER_DOWNLOAD_HOST: 'https://internal.artifactory/artifactory/storage-googleapis-cache'

      - name: Find affected
        id: find-affected
        run: echo "affected=$(node ./scripts/find-affected.js latest-release)" >> $GITHUB_OUTPUT

      - name: Build
        run: npm run build

      - name: Set .npmrc auth
        run: |
          curl -fsSL -u"${ARTIFACTORY_USER}:${ARTIFACTORY_API_KEY}" "https:///internal.artifactory/artifactory/api/npm/auth" > ./.npmrc
        env:
          ARTIFACTORY_USER: npm-publish
          ARTIFACTORY_API_KEY: ${{secrets.ARTIFACTORY_API_KEY}}

      - name: Version and publish
        run: npx nx affected ${{ fromJSON(steps.find-affected.outputs.affected).affectedMatrix }} --base=${{ fromJSON(steps.find-affected.outputs.affected).tagSha }} --target version --parallel=1 --trackDeps --skipCommit --releaseAs=prerelease --preid=alpha
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

      - name: Push tags
        run: git push origin --tags --force
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant