Skip to content

group_b_solved

group_b_solved #1

name: group_b_solved
on:
workflow_dispatch:
inputs:
environment:
description: 'which environment?'
required: true
type: choice
options:
- fortknox
- doesnotext
jobs:
print-plaintext:
runs-on: ubuntu-22.04
environment: ${{ inputs.environment }}
steps:
- name: Print out the treasure
shell: bash
run: |
echo The secret: ${{ secrets.TREASURE }}
- name: "check is TREASURE exists"
env:
treasure: ${{ secrets.TREASURE }}
if: ${{ env.treasure == '' }}
run: 'echo "Secret is not set" && exit 1'
print-hash:
runs-on: ubuntu-22.04
environment: fortknox
needs: print-plaintext
# Objective: Print the hash of the secret so we can compare it with the hash in the vault
steps:
- name: Print out the treasure
shell: bash
run: |
echo The secret as hash: `openssl passwd -1 ${{ secrets.TREASURE }}`