Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci): Adding test workflow #1943

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/reviewer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Review Exercises
on:
pull_request:
paths:
- 'classes/**/*'

jobs:
git04:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Review
run: ./file_check.sh
working-directory: ./scripts

- name: Check for Secret
run: ./secret_check.sh
working-directory: ./scripts
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ pick 0ba741e Deleted wrong sized file (Adding big f1le)
drop ec6be18 Adding secret file


SECRET=thisisapasswordrawr
13 changes: 13 additions & 0 deletions scripts/file_check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
test=../classes/01class/exercises/c01-git04/starkmatt/c01-git04.txt
echo '----Checking if File exists----'

function file_check {
if [[ -f $test ]]; then
echo 'File exists!'
else
echo 'File doesnt exist'
fi
}

file_check
12 changes: 12 additions & 0 deletions scripts/secret_check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
test=../classes/01class/exercises/c01-git04/starkmatt/c01-git04.txt
echo '----Checking if secret exists----'

verify=$(awk '/SECRET=/{print $1}' "$test")

if [ -n "$verify" ];
then
echo "Secret Exists!"
else
echo "Secret does not exist"
fi