Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jongwooo committed Dec 21, 2023
0 parents commit cc20867
Show file tree
Hide file tree
Showing 7 changed files with 168 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @sonaractions/admins
65 changes: 65 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# How to Contribute

## Submitting a pull request

### Forked strategy

This repository managed based on forked pull request strategy.

```sh
# Fork this repository to yours.
$ git clone [YOUR_REPOSITORY_URL]
$ cd scanner-cache

# (Working...)

$ git commit [...]
$ git push origin [YOUR_REPOSITORY]

# Enroll pull-request!
# in https://github.com/sonaractions/scanner-cache
```

## Commit message rules

Each commit message consists of a **header**, a **body** and a **footer**.
The header has a special format that includes a **type**, a **scope** and a **subject**:

```text
<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>
```

### Type

Must be one of the following:

- **feat**: When create a new feature.
- **fix**: When fix a bug.
- **docs**: When add or change documentation.
- **style**: When improve code style.
- **refactor**: When improve code without add or change feature.
- **perf**: When improve performance.
- **test**: When add or change test code.
- **chore**: When change build process or tool.
- **revert**: When revert a commit.
- **misc**: When something else entirely.

### Scope

The scope could be anything specifying place of the commit change.
For example `deps-dev`, `workflows`, etc...

### Subject

The first part of the commit message begins with an infinitive, and the first letter is capitalized.
It starts with commands such as `Fix`, `Add` and `Change` instead of past tense such as `Fixed`, `Added`
and `Changed`. In addition, It does not exceed 72 characters and does not end with a period (.).

- `Fixed` -> `Fix`
- `Added` -> `Add`
- `Changed` -> `Change`

7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: "weekly"

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.idea/
.DS_Store
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Sonar Actions

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
49 changes: 49 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# SonarQube Scanner Cache

Cache [SonarQube](https://www.sonarsource.com/products/sonarqube/) scanner.

[![LICENSE](https://img.shields.io/github/license/sonaractions/scanner-cache?color=blue)](LICENSE)
[![GitHub stars](https://img.shields.io/github/stars/sonaractions/scanner-cache?style=social)](https://github.com/sonaractions/scanner-cache)

## Usage

### Pre-requisites

Create a workflow `.yml` file in your repositories `.github/workflows` directory. For more information, reference the GitHub Help Documentation for [Creating a workflow file](https://help.github.com/en/articles/configuring-a-workflow#creating-a-workflow-file).

### Cache Details

This action currently caches the following directory:

- `~/.sonar/scanner`

### Example workflow

```yaml
- uses: actions/checkout@v4

- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: 'maven'

- name: Cache SonarQube packages
uses: sonaractions/cache@v1

- name: Cache SonarQube scanner
id: cache-sonar-scanner
uses: sonaractions/scanner-cache@v1

- name: Install SonarQube scanner
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
```
## Contributing
Check out [Contributing guide](.github/CONTRIBUTING.md) for ideas on contributing and setup steps for getting our repositories up.
## License
Licensed under the [MIT License](LICENSE).
23 changes: 23 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: "SonarQube Scanner Cache"
description: "Cache SonarQube scanner."
author: "sonaractions"

outputs:
cache-hit:
description: "A boolean value to indicate an exact match was found for the primary key."
value: ${{ steps.cache-sonar-scanner.outputs.cache-hit }}

runs:
using: "composite"
steps:
- uses: actions/cache@v3
id: cache-sonar-scanner
with:
path: ~/.sonar/scanner
key: ${{ runner.os }}-sonar-scanner
restore-keys: ${{ runner.os }}-sonar-scanner

branding:
icon: "archive"
color: "purple"

0 comments on commit cc20867

Please sign in to comment.