Skip to content

Update main.yml

Update main.yml #44

Workflow file for this run

name: CICD-Workshop
on:
push:
branches:
# 1.The pipeline should be triggered whenever this is a push to a branch name with the following pattern release/v<digit>.<digit>
- 'main'
jobs:
secret-generator:
runs-on: ubuntu-latest
outputs:
total: ${{ steps.generate-secret.outputs.total }}
steps:
- name: generate secret
id: generate-secret
shell: bash
run: |
SECRET_HANDLE=$(echo 123456)
echo "total=$SECRET_HANDLE" >> "$GITHUB_OUTPUT"
secret-consumer:
runs-on: macos-latest
needs: secret-generator
if: ${{ needs.secret-generator.outputs.total == '123456' }}
steps:
- name: use secret
shell: bash
run: |
# SECRET_HANDLE="${{ needs.secret-generator.outputs.handle }}"
echo "We retrieved our masked secret: SECRET_HANDLE"