Skip to content

Commit

Permalink
Merge pull request #46 from fingerprintjs/fix-commitlint-action
Browse files Browse the repository at this point in the history
Fix node cache for nodeless repos
  • Loading branch information
ilfa authored Jan 29, 2024
2 parents a5a196f + f1fdd95 commit ec0c036
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 25 deletions.
16 changes: 11 additions & 5 deletions .github/workflows/analyze-commits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,23 @@ jobs:
name: Analyze Commit Messages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 'Determine package manager'
run: |
if [[ -f "pnpm-lock.yaml" ]]; then
echo "Using pnpm"
echo "PACKAGE_MANAGER=pnpm" >> $GITHUB_ENV
else
echo "PACKAGE_MANAGER_CACHE=" >> $GITHUB_ENV
elif [[ -f "yarn.lock" ]]; then
echo "Using yarn"
echo "PACKAGE_MANAGER=yarn" >> $GITHUB_ENV
echo "PACKAGE_MANAGER_CACHE=yarn" >> $GITHUB_ENV
else
echo "No package manager lock file found"
echo "PACKAGE_MANAGER=yarn" >> $GITHUB_ENV
echo "PACKAGE_MANAGER_CACHE=" >> $GITHUB_ENV
fi
- if: ${{ env.PACKAGE_MANAGER == 'pnpm' }}
name: 'Install pnpm'
Expand All @@ -39,7 +45,7 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.nodeVersion }}
cache: ${{ env.PACKAGE_MANAGER }}
cache: ${{ env.PACKAGE_MANAGER_CACHE }}
- name: 'Install Node packages'
run: $PACKAGE_MANAGER install
- uses: wagoid/commitlint-github-action@5ce82f5d814d4010519d15f0552aec4f17a1e1fe
Expand Down Expand Up @@ -86,11 +92,11 @@ jobs:
env:
TEST_MESSAGE: ${{ inputs.isTest && '### ⚠️ This is a test run of the release-notes-comment action that can be found in .github/workflows/analyze-commits.yml' || ''}}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 'Install latest node version'
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.nodeVersion }}
- name: Collect semantic-release-info
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-typescript-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ jobs:
steps:
- name: 'Checkout project for pull_request_target trigger'
if: ${{ github.event_name == 'pull_request_target' }}
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: 'Checkout project for other scenarios'
if: ${{ github.event_name != 'pull_request_target' }}
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: 'Determine package manager'
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/coverage-diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
name: Run tests & check coverage
steps:
- name: Checkout the repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: 'Determine package manager'
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/create-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
if: inputs.prerelease == false
run: exit 1
- name: Checkout rc branch
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: 'rc'

Expand All @@ -38,7 +38,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout main branch
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: 'main'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs-and-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: 'Determine package manager'
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/move-v1-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Check branch
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-dx-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ jobs:
environment: production-npm
steps:
- name: Checkout Repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@ebcfd6995dade4b0104ac774445cef8b3b4635b0
with:
version: 8

- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: pnpm
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/release-server-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,45 +40,45 @@ jobs:
environment: production
steps:
- name: 'Checkout repository'
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
persist-credentials: false

- name: 'Install Java'
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'zulu' # See 'Supported distributions' for available options
java-version: ${{ inputs.java-version }}
cache: ${{ inputs.language == 'java' && 'gradle' || '' }}

- name: 'Install DotNET'
if: ${{ inputs.language == 'dotnet' }}
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ inputs.language-version }}

- name: 'Install Python'
if: ${{ inputs.language == 'python' }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.language-version }}

- name: 'Install Golang'
if: ${{ inputs.language == 'golang' }}
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: ${{ inputs.language-version }}

- name: 'Install Flutter'
if: ${{ inputs.language == 'flutter' }}
uses: subosito/flutter-action@0c3f14223a08fa950c8a4c00bcfb834e65744135
uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225
with:
flutter-version: ${{ inputs.language-version }}
channel: 'stable'

- name: 'Install PHP'
if: ${{ inputs.language == 'php' }}
uses: shivammathur/setup-php@72ae4ccbe57f82bbe08411e84e2130bd4ba1c10f
uses: shivammathur/setup-php@6d7209f44a25a59e904b1ee9f3b0c33ab2cd888d
with:
php-version: ${{ inputs.language-version }}
coverage: none
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-typescript-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
environment: production
steps:
- name: 'Checkout'
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
persist-credentials: false

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,10 @@ jobs:
matrix:
node-version: [ 10, 12, 14, 16, 17, 18, 19, 20 ]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- uses: actions/download-artifact@v3
Expand Down Expand Up @@ -387,7 +387,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
# ... other steps ...
report-status:
Expand Down

0 comments on commit ec0c036

Please sign in to comment.