Skip to content

Use env setup and test run action #416

Use env setup and test run action

Use env setup and test run action #416

name: Test extract-metadata action
on:
push:
pull_request:
branches: [main]
jobs:
test-extract-metadata:
name: Retrieves metadata
runs-on: ubuntu-20.04
steps:
- name: Check that environment is empty
run: '[[ -z "$IMAGE_NAME" && -z "$COMMIT_ID" && -z "$BRANCH_NAME" ]]'
- name: Call action to initialize environment
uses: HSLdevcom/jore4-tools/github-actions/extract-metadata@extract-metadata-v1
- name: Environment variables are set after action is called
run: '[[ -n "$IMAGE_NAME" && -n "$COMMIT_ID" && -n "$BRANCH_NAME" ]]'
- name: Check that IMAGE_NAME environment variable is created and is valid
run: '[[ "$IMAGE_NAME" == "hsldevcom/jore4-tools" ]]'
# (tests for BRANCH_NAME, CURRENT_DATE and COMMIT_ID are omitted for now as they might change on each run so its a little bit tricky to test those)