1
0
Fork 0
mirror of https://github.com/karancode/yamllint-github-action.git synced 2024-08-16 10:19:48 +02:00

fix(test): adapt test validation (#18)

* fix(test): adapt test validation

Related to the change in
https://github.com/karancode/yamllint-github-action/pull/17

* feat(action): run CI on pull request against master
This commit is contained in:
Tung Beier 2023-03-14 16:10:12 +01:00 committed by GitHub
parent fdef6bc189
commit 35d356f02b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 9 deletions

View file

@ -6,6 +6,9 @@ on:
- 'dependabot/*' - 'dependabot/*'
schedule: schedule:
- cron: '22 22 * * 5' - cron: '22 22 * * 5'
pull_request:
branches:
- 'master'
jobs: jobs:
test: test:

View file

@ -2,7 +2,7 @@
# NOTE: environment variable GITHUB_EVENT_PATH # NOTE: environment variable GITHUB_EVENT_PATH
# is required in a pullrequest scenario. If the variable # is required in a pullrequest scenario. If the variable
# is not set the test the test is gonna hang. # is not set the test is gonna hang.
# global variables ############################################################ # global variables ############################################################
CONTAINER_NAME="yamllint-github-action" CONTAINER_NAME="yamllint-github-action"
@ -73,7 +73,7 @@ function setup() {
echo $output | grep -q "lint: error: failed yamllint on" echo $output | grep -q "lint: error: failed yamllint on"
echo $output | grep -q "line too long (114 > 80 characters)" echo $output | grep -q "line too long (114 > 80 characters)"
cat ${GITHUB_OUTPUT_FILE} | grep -q "yamllint_output=${INPUT_YAMLLINT_FILE_OR_DIR}" cat ${GITHUB_OUTPUT_FILE} | grep -q -Pzo "yamllint_output<<EOF\n$INPUT_YAMLLINT_FILE_OR_DIR"
[[ "${status}" -eq 1 ]] [[ "${status}" -eq 1 ]]
} }
@ -118,7 +118,7 @@ function setup() {
echo $output | grep -q "line too long (114 > 80 characters)" echo $output | grep -q "line too long (114 > 80 characters)"
echo $output | grep -q "lint: info: commenting on the pull request" echo $output | grep -q "lint: info: commenting on the pull request"
cat ${GITHUB_OUTPUT_FILE} | grep -q "yamllint_output=${INPUT_YAMLLINT_FILE_OR_DIR}" cat ${GITHUB_OUTPUT_FILE} | grep -q -Pzo "yamllint_output<<EOF\n$INPUT_YAMLLINT_FILE_OR_DIR"
[[ "${status}" -eq 1 ]] [[ "${status}" -eq 1 ]]
} }
@ -142,7 +142,7 @@ function setup() {
echo $output | grep -q "line too long (114 > 80 characters)" echo $output | grep -q "line too long (114 > 80 characters)"
echo $output | grep -q "lint: info: commenting on the pull request" echo $output | grep -q "lint: info: commenting on the pull request"
cat ${GITHUB_OUTPUT_FILE} | grep -q "yamllint_output=${INPUT_YAMLLINT_FILE_OR_DIR}" cat ${GITHUB_OUTPUT_FILE} | grep -q -Pzo "yamllint_output<<EOF\n$INPUT_YAMLLINT_FILE_OR_DIR"
[[ "${status}" -eq 1 ]] [[ "${status}" -eq 1 ]]
} }
@ -165,7 +165,7 @@ function setup() {
echo $output | grep -q "$INPUT_YAMLLINT_FILE_OR_DIR" echo $output | grep -q "$INPUT_YAMLLINT_FILE_OR_DIR"
echo $output | grep -vq "lint: info: commenting on the pull request" echo $output | grep -vq "lint: info: commenting on the pull request"
cat ${GITHUB_OUTPUT_FILE} | grep -vq "yamllint_output=${INPUT_YAMLLINT_FILE_OR_DIR}" cat ${GITHUB_OUTPUT_FILE} | grep -vq -Pzo "yamllint_output<<EOF\n$INPUT_YAMLLINT_FILE_OR_DIR"
[[ "${status}" -eq 0 ]] [[ "${status}" -eq 0 ]]
} }
@ -190,7 +190,7 @@ function setup() {
echo $output | grep -q "line too long (114 > 80 characters)" echo $output | grep -q "line too long (114 > 80 characters)"
echo $output | grep -vq "lint: info: commenting on the pull request" echo $output | grep -vq "lint: info: commenting on the pull request"
cat ${GITHUB_OUTPUT_FILE} | grep -q "yamllint_output=${INPUT_YAMLLINT_FILE_OR_DIR}" cat ${GITHUB_OUTPUT_FILE} | grep -q -Pzo "yamllint_output<<EOF\n$INPUT_YAMLLINT_FILE_OR_DIR"
[[ "${status}" -eq 1 ]] [[ "${status}" -eq 1 ]]
} }
@ -214,7 +214,7 @@ function setup() {
echo $output | grep -q "line too long (114 > 80 characters)" echo $output | grep -q "line too long (114 > 80 characters)"
echo $output | grep -vq "lint: info: commenting on the pull request" echo $output | grep -vq "lint: info: commenting on the pull request"
cat ${GITHUB_OUTPUT_FILE} | grep -q "yamllint_output=${INPUT_YAMLLINT_FILE_OR_DIR}" cat ${GITHUB_OUTPUT_FILE} | grep -q -Pzo "yamllint_output<<EOF\n$INPUT_YAMLLINT_FILE_OR_DIR"
[[ "${status}" -eq 1 ]] [[ "${status}" -eq 1 ]]
} }
@ -239,7 +239,7 @@ function setup() {
echo $output | grep -q "line too long (114 > 80 characters)" echo $output | grep -q "line too long (114 > 80 characters)"
echo $output | grep -vq "lint: info: commenting on the pull request" echo $output | grep -vq "lint: info: commenting on the pull request"
cat ${GITHUB_OUTPUT_FILE} | grep -q "yamllint_output=${INPUT_YAMLLINT_FILE_OR_DIR}" cat ${GITHUB_OUTPUT_FILE} | grep -q -Pzo "yamllint_output<<EOF\n$INPUT_YAMLLINT_FILE_OR_DIR"
[[ "${status}" -eq 1 ]] [[ "${status}" -eq 1 ]]
} }
@ -262,7 +262,7 @@ function setup() {
echo $output | grep -q "line too long (114 > 80 characters)" echo $output | grep -q "line too long (114 > 80 characters)"
echo $output | grep -vq "lint: info: commenting on the pull request" echo $output | grep -vq "lint: info: commenting on the pull request"
cat ${GITHUB_OUTPUT_FILE} | grep -q "yamllint_output=${INPUT_YAMLLINT_FILE_OR_DIR}" cat ${GITHUB_OUTPUT_FILE} | grep -q -Pzo "yamllint_output<<EOF\n$INPUT_YAMLLINT_FILE_OR_DIR"
[[ "${status}" -eq 1 ]] [[ "${status}" -eq 1 ]]
} }