-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
43 lines (39 loc) · 1.23 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: delete-comments
description: Delete uninformative SonarCloud PR comments
inputs:
userId:
required: true
description: User id
userLogin:
required: false
default: 'sonarcloud[bot]'
description: User login, defaults to 'sonarcloud[bot]'
userType:
required: false
default: 'Bot'
description: User type, defaults to 'Bot'
runs:
using: composite
steps:
# hashFiles() fails because package-lock.json is outside of WORKSPACE
- name: Get package-lock.json hash step
id: hash
run: echo "sha256=$(shasum --algorithm 256 $GITHUB_ACTION_PATH/package-lock.json | cut -d' ' -f1)" >> $GITHUB_OUTPUT
shell: bash
- name: Cache node_modules step
id: cache
uses: actions/cache@v4
with:
path: ${{ github.action_path }}/node_modules
key: delete-comment-action-${{ steps.hash.outputs.sha256 }}
- name: Install dependencies step
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
run: cd $GITHUB_ACTION_PATH && npm ci --ignore-scripts
shell: bash
- name: Run action step
run: node $GITHUB_ACTION_PATH/index.js
shell: bash
env:
INPUT_USERID: ${{ inputs.userId }}
INPUT_USERLOGIN: ${{ inputs.userLogin }}
INPUT_USERTYPE: ${{ inputs.userType }}