Skip to content

Commit

Permalink
Move action to composite (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeeus committed Oct 25, 2020
1 parent fcee962 commit 02daeb3
Show file tree
Hide file tree
Showing 17 changed files with 442 additions and 132 deletions.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: false
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: Feature request
about: Suggest an idea for this project
labels: "Feature Request"
---

## Checklist

- [ ] This Feature Request only contains 1 request (if you have multiple open multiple feature requests).

## The idea

A good description of what you are suggesting.

## Implementation

How do you see this being implemented?

## Alternatives

Are there any alternative solutions or features you've considered?

## Additional context

14 changes: 14 additions & 0 deletions .github/ISSUE_TEMPLATE/issue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: "Issue"
about: For issue reporting.
labels: "bug"
---

## Describe the issue

A clear and concise description of what the issue is.

### Links

- **Link to action run:**
- **Link to action configuration:**
15 changes: 0 additions & 15 deletions .github/workflows/ShellCheck.yml

This file was deleted.

42 changes: 42 additions & 0 deletions .github/workflows/additional_files.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: 'additional_files'

on:
push:
branches: ["master"]
pull_request:

jobs:
additional_files:
name: additional_files
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Run ShellCheck
uses: ./
id: check
with:
additional_files: run finish discovery
ignore: ignore
scandir: testfiles

- name: Verify check
run: |
expect="testfiles/scandir/run"
if [[ ! "${{ steps.check.outputs.files }}" =~ testfiles/scandir/run ]];then
echo "::error:: Expected file testfiles/scandir/run not found in ${{ steps.check.outputs.files }}"
exit 1
elif [[ ! "${{ steps.check.outputs.files }}" =~ testfiles/scandir/finish ]];then
echo "::error:: Expected file testfiles/scandir/finish not found in ${{ steps.check.outputs.files }}"
exit 1
elif [[ ! "${{ steps.check.outputs.files }}" =~ testfiles/scandir/discovery ]];then
echo "::error:: Expected file testfiles/scandir/discovery not found in ${{ steps.check.outputs.files }}"
exit 1
fi
38 changes: 38 additions & 0 deletions .github/workflows/base.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: 'base'

on:
push:
branches: ["master"]
pull_request:

jobs:
base:
name: base
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Run ShellCheck
uses: ./
id: check
with:
ignore: ignore

- name: Verify check
run: |
expect="testfiles/test.bash"
notexpect="testfiles/ignore/ignore.bash"
if [[ ! "${{ steps.check.outputs.files }}" =~ $expect ]];then
echo "::error:: Expected file $expect not found in ${{ steps.check.outputs.files }}"
exit 1
elif [[ "${{ steps.check.outputs.files }}" =~ $notexpect ]];then
echo "::error:: Expected file $notexpect found in ${{ steps.check.outputs.files }}"
exit 1
fi
39 changes: 39 additions & 0 deletions .github/workflows/check_together.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: 'check_together'

on:
push:
branches: ["master"]
pull_request:

jobs:
check_together:
name: check_together
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Run ShellCheck
uses: ./
id: check
with:
ignore: ignore
check_together: true

- name: Verify check
run: |
expect="testfiles/test.bash"
notexpect="testfiles/ignore/ignore.bash"
if [[ ! "${{ steps.check.outputs.files }}" =~ $expect ]];then
echo "::error:: Expected file $expect not found in ${{ steps.check.outputs.files }}"
exit 1
elif [[ "${{ steps.check.outputs.files }}" =~ $notexpect ]];then
echo "::error:: Expected file $notexpect found in ${{ steps.check.outputs.files }}"
exit 1
fi
58 changes: 58 additions & 0 deletions .github/workflows/scandir.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: 'scandir'

on:
push:
branches: ["master"]
pull_request:

jobs:
scandir:
name: scandir
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Run ShellCheck
uses: ./
id: one
with:
scandir: testfiles/scandir

- name: Verify check
run: |
expect="testfiles/scandir/test.bash"
notexpect="testfiles/test.bash"
if [[ ! "${{ steps.one.outputs.files }}" =~ $expect ]];then
echo "::error:: Expected file $expect not found in ${{ steps.one.outputs.files }}"
exit 1
elif [[ "${{ steps.one.outputs.files }}" =~ $notexpect ]];then
echo "::error:: Expected file $notexpect found in ${{ steps.one.outputs.files }}"
exit 1
fi
- name: Run ShellCheck
uses: ./
id: two
with:
scandir: './testfiles/scandir'
ignore: ignore

- name: Verify check
run: |
expect="testfiles/scandir/test.bash"
notexpect="testfiles/test.bash"
if [[ ! "${{ steps.two.outputs.files }}" =~ $expect ]];then
echo "::error:: Expected file $expect not found in ${{ steps.two.outputs.files }}"
exit 1
elif [[ "${{ steps.two.outputs.files }}" =~ $notexpect ]];then
echo "::error:: Expected file $notexpect found in ${{ steps.two.outputs.files }}"
exit 1
fi
8 changes: 0 additions & 8 deletions Dockerfile

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019 ludeeus
Copyright (c) 2020 ludeeus

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,28 @@ one of them, you can use the following configuration:
with:
scandir: './scripts'
```

## Scan for additional files

If you need to scan for unusual files, you can use the `additional_files` key.

```yaml
...
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
with:
additional_files: 'run finish'
```

## Disable problem matcher

If you do not want to have the problem-matcher annotate files, you can disable it
by setting `disable_matcher` to `true`.

```yaml
...
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
with:
disable_matcher: true
```
Loading

0 comments on commit 02daeb3

Please sign in to comment.