fix(ci): Use long commit SHA when creating git tags during new releas… #5444
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: Check & Release | |
| on: | |
| push: | |
| branches: [ master, renovate/** ] | |
| pull_request: | |
| branches: [ master ] | |
| jobs: | |
| test: | |
| name: Test | |
| if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| node-version: [ 20, 22, 24 ] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Use Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| - name: Install pnpm and dependencies | |
| uses: apify/actions/pnpm-install@v1.1.2 | |
| - name: Run Tests | |
| run: pnpm test | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Use Node.js 24 | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| - name: Install pnpm and dependencies | |
| uses: apify/actions/pnpm-install@v1.1.2 | |
| - run: pnpm build | |
| - name: Check build consistency | |
| run: | | |
| git diff --exit-code || { | |
| echo -e "Some files changed after running pnpm build! Please build the project locally and commit the changes."; | |
| exit 1; | |
| } | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Use Node.js 24 | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| - name: Install pnpm and dependencies | |
| uses: apify/actions/pnpm-install@v1.1.2 | |
| - run: pnpm lint | |
| format-check: | |
| name: Format check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Use Node.js 24 | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| - name: Install pnpm and dependencies | |
| uses: apify/actions/pnpm-install@v1.1.2 | |
| - run: pnpm format:check | |
| publish: | |
| name: Publish to NPM | |
| if: github.ref == 'refs/heads/master' | |
| needs: [ test, build, lint, format-check ] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 # we need to pull everything to allow lerna to detect what packages changed | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| - name: Install pnpm and dependencies | |
| uses: apify/actions/pnpm-install@v1.1.2 | |
| - name: Check for changes | |
| id: changed_packages | |
| run: | | |
| echo "changed_packages=$(pnpm exec lerna changed -p | wc -l | xargs)" | tee -a $GITHUB_OUTPUT | |
| - name: Execute publish workflow | |
| if: steps.changed_packages.outputs.changed_packages != '0' | |
| uses: apify/actions/execute-workflow@v1.1.2 | |
| with: | |
| workflow: publish_to_npm.yaml | |
| inputs: > | |
| { | |
| "ref": "master" | |
| } |