Skip to content
Merged
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
48 changes: 48 additions & 0 deletions .github/workflows/pattern-sh-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Run Bash Script on Multiple Distributions

on:
push:
paths:
- "scripts/**"
- "Makefile"
branches:
- main
pull_request:
paths:
- "scripts/**"
- "Makefile"

jobs:
run-script:
name: Run Bash Script
strategy:
matrix:
# Fedora is not an option yet
os: [ubuntu-latest, ubuntu-22.04]
runs-on: ${{ matrix.os }}

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Install Podman on Ubuntu
if: contains(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install -y podman

# Currently we do not do MacOSX as it is not free, maybe in the future
# - name: Install Podman on macOS
# if: contains(matrix.os, 'macos')
# run: |
# brew install podman
# podman machine init
# podman machine start

- name: Verify Podman Installation
run: podman --version

- name: Run pattern.sh script
run: |
export TARGET_BRANCH=main
./scripts/pattern-util.sh make validate-origin
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ TARGET_ORIGIN ?= origin
# This is because we expect to use tokens for repo authentication as opposed to SSH keys
TARGET_REPO=$(shell git ls-remote --get-url --symref $(TARGET_ORIGIN) | sed -e 's/.*URL:[[:space:]]*//' -e 's%^git@%%' -e 's%^https://%%' -e 's%:%/%' -e 's%^%https://%')
# git branch --show-current is also available as of git 2.22, but we will use this for compatibility
TARGET_BRANCH=$(shell git rev-parse --abbrev-ref HEAD)
TARGET_BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD)

UUID_FILE ?= ~/.config/validated-patterns/pattern-uuid
UUID_HELM_OPTS ?=
Expand Down
1 change: 1 addition & 0 deletions scripts/pattern-util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ podman run -it --rm --pull=newer \
-e EXTRA_PLAYBOOK_OPTS \
-e TARGET_ORIGIN \
-e TARGET_SITE \
-e TARGET_BRANCH \
-e NAME \
-e TOKEN_SECRET \
-e TOKEN_NAMESPACE \
Expand Down