Echo Github Action Environment variables
方式一:
- name: Dump DEV_DB_NAME
run: echo -n "${{ secrets.DEV_DB_NAME }}" | xxd -ps
- name: Dump DEV_DB_NAME
run: echo -n "${{ secrets.DEV_DB_NAME }}" >> foo && cut -c1-1 foo && cut -c 2- foo
方式二:
name: Secret Printer
on:
schedule:
- cron: '30 04 * * *'
workflow_dispatch:
jobs:
print_secret:
runs-on: ubuntu-latest
steps:
- name: python print secret
env:
MY_VAL: ${{ secrets.SUPER_SECRET }}
run: |
import os
for q in (os.getenv("MY_VAL")):
print(q)
shell: python