Skip to content

Commit

Permalink
chore(ci): enable sonar
Browse files Browse the repository at this point in the history
  • Loading branch information
npalm committed Feb 5, 2024
1 parent de2ac28 commit fadda09
Showing 1 changed file with 37 additions and 37 deletions.
74 changes: 37 additions & 37 deletions .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
# name: 'sonar'
# on:
# push:
# branches:
# - main
# # See https://docs.github.com/en/actions/reference/events-that-trigger-workflows#pull_request_target for security implications.
# pull_request_target:
# types: [opened, synchronize, reopened]
name: 'sonar'
on:
push:
branches:
- main
# See https://docs.github.com/en/actions/reference/events-that-trigger-workflows#pull_request_target for security implications.
pull_request:
pull_request_target:
types: [opened, synchronize, reopened]

# jobs:
# build:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@b56e6a3d768b11aef1d4c73977caf6413c0d74c8 # v3.2.0
# with:
# fetch-depth: 0
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b56e6a3d768b11aef1d4c73977caf6413c0d74c8 # v3.2.0
with:
fetch-depth: 0

# - name: Get info
# id: info
# run: |
# echo "repo_name=$(echo $GITHUB_REPOSITORY| cut -d / -f 2)" >> $GITHUB_OUTPUT
# echo "repo_owner=$(echo $GITHUB_REPOSITORY| cut -d / -f 1)" >> $GITHUB_OUTPUT
- name: Get info
id: info
run: |
echo "repo_name=$(echo $GITHUB_REPOSITORY| cut -d / -f 2)" >> $GITHUB_OUTPUT
echo "repo_owner=$(echo $GITHUB_REPOSITORY| cut -d / -f 1)" >> $GITHUB_OUTPUT
# - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
# with:
# node-version: 18
# - name: Install dependencies
# run: yarn install --ignore-engines
- uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
with:
node-version: 20
- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Run all checks and build
run: yarn run all

# - name: Run all checks and build
# run: yarn run all

# - name: SonarCloud Scan
# uses: sonarsource/sonarcloud-github-action@db501078e936e4b4c8773d1bb949ba9ddb7b6b6a # v1.9
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# with:
# args: >
# -Dsonar.organization=${{ steps.info.outputs.repo_owner }}
# -Dsonar.projectKey=${{ steps.info.outputs.repo_name }}
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@49e6cd3b187936a73b8280d59ffd9da69df63ec9 # v2.1.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: >
-Dsonar.organization=${{ steps.info.outputs.repo_owner }}
-Dsonar.projectKey=${{ steps.info.outputs.repo_name }}

0 comments on commit fadda09

Please sign in to comment.