Skip to content

Commit 3cdbdfc

Browse files
committed
ci: Use Differential ShellCheck action
(cherry picked from commit 3eee590)
1 parent c4ee2af commit 3cdbdfc

File tree

6 files changed

+19
-247
lines changed

6 files changed

+19
-247
lines changed

.github/workflows/check-shell.sh

Lines changed: 0 additions & 111 deletions
This file was deleted.

.github/workflows/functions.sh

Lines changed: 0 additions & 93 deletions
This file was deleted.
Lines changed: 11 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,23 @@
1-
# GA doc: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
2-
# github-script doc: https://github.com/marketplace/actions/github-script
3-
name: Shellcheck test
1+
name: Differential ShellCheck
42
on:
3+
push:
4+
branches: [master, rhel*-branch]
55
pull_request:
6-
branches:
7-
- master
8-
- rhel*-branch
9-
- new-feature-actions-PR-comments
6+
branches: [master, rhel*-branch]
107

118
jobs:
129
shellCheck:
1310
runs-on: ubuntu-20.04
14-
defaults:
15-
run:
16-
shell: bash
1711

18-
steps:
19-
- name: Install dependencies
20-
run: sudo apt update && sudo apt-get install -y cmake help2man libboost-dev libboost-filesystem-dev libboost-program-options-dev libboost-python-dev libboost-regex-dev tree
21-
22-
- name: Clone csdiff repository
23-
run: cd ../ && git clone --depth=1 https://github.com/csutils/csdiff.git && cd -
24-
25-
- name: Build and install csdiff
26-
run: cd ../csdiff && sudo make && sudo make install && cd -
27-
28-
- name: Repository checkout
12+
steps:
13+
- name: Checkout
2914
uses: actions/checkout@v2
3015
with:
3116
fetch-depth: 0
3217
ref: ${{ github.event.pull_request.head.sha }}
33-
34-
- name: Run shell-check test
35-
run: |
36-
bash ./.github/workflows/check-shell.sh ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }}
3718

38-
# ! Disable Output, since there is a problem with permissions and GITHUB_TOKEN
39-
# ! https://github.blog/changelog/2021-04-20-github-actions-control-permissions-for-github_token/
40-
# TODO: possible solution is to use probot framework to build github app/action
41-
# TODO: Set labels based on env.NUMBER_OF_ADDED_ISSUES and env.NUMBER_OF_SOLVED_ISSUES
42-
# - name: Output test results
43-
# # Run this step even if previous failed
44-
# if: always()
45-
# uses: actions/github-script@v5
46-
# with:
47-
# # Colored GH comments: https://stackoverflow.com/a/39413824
48-
# script: |
49-
# github.rest.issues.createComment({
50-
# issue_number: context.issue.number,
51-
# owner: context.repo.owner,
52-
# repo: context.repo.repo,
53-
# body: '```diff\n@@ Shellcheck test summary @@\n- added issues: ${{ env.NUMBER_OF_ADDED_ISSUES }}\n+ solved issues: ${{ env.NUMBER_OF_SOLVED_ISSUES }}\n\n# list of edited shell scripts:\n${{ env.LIST_OF_SCRIPTS }}\n```'
54-
# })
19+
- name: Differential ShellCheck
20+
uses: redhat-plumbers-in-action/differential-shellcheck@v1
21+
with:
22+
ignored-codes: .github/.diff-shellcheck-exceptions.txt
23+
shell-scripts: .github/.diff.shellcheck-scripts.txt

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
# initscripts | [![Build Status](https://travis-ci.org/fedora-sysv/initscripts.svg?branch=master)](https://travis-ci.org/fedora-sysv/initscripts)
1+
# initscripts
2+
3+
[![Build Status](https://github.com/fedora-sysv/initscripts/workflows/Integration%20test/badge.svg)](https://github.com/fedora-sysv/initscripts/actions?query=workflow%3AIntegration+test) [![Differential ShellCheck](https://github.com/fedora-sysv/initscripts/actions/workflows/shellcheck_test.yml/badge.svg)](https://github.com/fedora-sysv/initscripts/actions/workflows/shellcheck_test.yml) [![Total alerts](https://img.shields.io/lgtm/alerts/g/fedora-sysv/initscripts.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/fedora-sysv/initscripts/alerts/) [![Language grade: Python](https://img.shields.io/lgtm/grade/python/g/fedora-sysv/initscripts.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/fedora-sysv/initscripts/context:python) [![Language grade: C/C++](https://img.shields.io/lgtm/grade/cpp/g/fedora-sysv/initscripts.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/fedora-sysv/initscripts/context:cpp) [![Mergify Status][mergify-status]][mergify]
4+
5+
[mergify]: https://mergify.io
6+
[mergify-status]: https://img.shields.io/endpoint.svg?url=https://dashboard.mergify.io/badges/fedora-sysv/initscripts&style=flat
7+
8+
29
This repository contains source code for **legacy** *System V [initscripts](https://en.wikipedia.org/wiki/Init)*,
310
which are primarily used in *[Linux](https://en.wikipedia.org/wiki/Linux) distributions like e.g.*:
411
* [Fedora](https://en.wikipedia.org/wiki/Fedora_(operating_system))

0 commit comments

Comments
 (0)