|
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 |
4 | 2 | on: |
| 3 | + push: |
| 4 | + branches: [master, rhel*-branch] |
5 | 5 | pull_request: |
6 | | - branches: |
7 | | - - master |
8 | | - - rhel*-branch |
9 | | - - new-feature-actions-PR-comments |
| 6 | + branches: [master, rhel*-branch] |
10 | 7 |
|
11 | 8 | jobs: |
12 | 9 | shellCheck: |
13 | 10 | runs-on: ubuntu-20.04 |
14 | | - defaults: |
15 | | - run: |
16 | | - shell: bash |
17 | 11 |
|
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 |
29 | 14 | uses: actions/checkout@v2 |
30 | 15 | with: |
31 | 16 | fetch-depth: 0 |
32 | 17 | 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 }} |
37 | 18 |
|
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 |
0 commit comments