The version of Java (1.8.0_282) you have used to run this analysis is deprecated and we stopped accepting it. Please update to at least Java 11. Temporarily you can set the property 'sonar.scanner.force-deprecated-java-version-grace-period' to 'true' to continue using Java 1.8.0_282 This will only work until Mon Feb 15 09:00:00 UTC 2021, afterwards all scans will fail. You can find more information here: https://sonarcloud.io/documentation/upcoming/
ERROR: The SonarScanner did not complete successfully 08:24:36.417 Post-processing failed. Exit code: 1 Error: Process completed with exit code 1.
調整方法
移除掉原本的 SonarScanner
1 2 3 4 5
- name: SonarScanner Begin run: dotnet sonarscanner begin /k:"Marsen.NetCore.Dojo" /o:"marsen-github" /d:"sonar.host.url=https://sonarcloud.io" /d:"sonar.login="$SONAR_LOGIN ## 中略 - name: SonarScanner End run: dotnet sonarscanner end /d:"sonar.login="$SONAR_LOGIN
在整個方案的根目錄加上一個檔案sonar-project.properties,
1 2 3 4 5 6
sonar.organization=<replace with your SonarCloud organization key> sonar.projectKey=<replace with the key generated when setting up the project on SonarCloud>
# relative paths to source directories. More details and properties are described # in https://sonarcloud.io/documentation/project-administration/narrowing-the-focus/ sonar.sources=.
# .github/workflows/chromatic.yml # name of our action name:"Chromatic Deployment" # the event that will trigger the action on: # Trigger the workflow on push or pull request, # but only for the main branch push: branches: -main # what the action will do jobs: test: # the operating system it will run on runs-on:ubuntu-latest # the list of steps that the action will go through steps: -uses:actions/checkout@v2 -run:cdsrc/marsen.react&&yarn&&yarnbuild&&yarnbuild-storybook -uses:chromaui/action@v1 with: projectToken:${{secrets.CHROMATIC_PROJECT_TOKEN}} token:${{secrets.GITHUB_TOKEN}} storybookBuildDir:storybook-static
// Configures Storybook to log the actions(onArchiveTask and onPinTask) in the UI. exportconst parameters = { actions: { argTypesRegex: '^on[A-Z].*' }, };
// A simple redux store/actions/reducer implementation. // A true app would be more complex and separated into different files. import { createStore } from'redux'; import { TaskItem, TaskState } from'../components/Task';
// The reducer describes how the contents of the store change for each action exportconstreducer = (state: any, action: { id:string; type: TaskState; }) => { switch (action.type) { caseTaskState.Archived: caseTaskState.Pinned: returntaskStateReducer(action.type)(state, action); default: return state; } };
// The initial state of our store when the app loads. // Usually you would fetch this from a server constdefaultTasks:Array<TaskItem> = [ { id: '1', title: 'Something', state: TaskState.Inbox }, { id: '2', title: 'Something more', state: TaskState.Inbox }, { id: '3', title: 'Something else', state: TaskState.Inbox }, { id: '4', title: 'Something again', state: TaskState.Inbox }, ];
// We export the constructed redux store exportdefaultcreateStore(reducer, { tasks: defaultTasks });
// All our reducers simply change the state of a single task. functiontaskStateReducer(taskState: TaskState) { return(state: { tasks: TaskItem[]; }, action: { id: string; }) => { return { ...state, tasks: state.tasks.map(task => task.id === action.id ? { ...task, state: taskState } : task ), }; }; }