Skip to content
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
15 changes: 15 additions & 0 deletions .github/workflows/pipeline_linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Pipeline-Linter

on:
pull_request:
branches: [master]

jobs:
syntax_check:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v5

- name: Check Jenkinsfile file
run: bash ./tests/pipeline_linter.sh Jenkinsfile
3 changes: 3 additions & 0 deletions tests/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Pipeline Linter

[How to run Pipeline Linter locally](https://github.com/fedora-ci/docs/blob/master/docs/command_line_pipeline_linter.md)
18 changes: 18 additions & 0 deletions tests/pipeline_linter.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/bash

if [ $# -ne 1 ]; then
echo $0: "USAGE: ./pipeline_linter.sh jenkins_filename"
exit 1
fi

FILE=$1

OUTPUT=$(curl -X POST -F "jenkinsfile=<$FILE" https://osci-jenkins-1.ci.fedoraproject.org/pipeline-model-converter/validate)

if [[ "$OUTPUT" =~ .*"successfully validated".* ]]; then
echo "$OUTPUT"
exit 0
else
echo "$OUTPUT"
exit 1
fi