Update main.yml #44
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |