GitHub Actions: How to mask workflow_dispatch inputs, like secrets?

Viewed 1328
1 Answers

This doesn't seem to be currently supported by Github but you can retrieve the input and store it in a variable and then mask it, something like this:

on:
  workflow_dispatch:
    inputs:
      secret_value:
        type: string
        required: true
        description: Secret Value

jobs:
  secrets:
    runs-on: ubuntu-latest
    steps:
      - name: Masking inputs
        run: |
          SECRET_VALUE=$(cat $GITHUB_EVENT_PATH | jq -r '.inputs.secret_value' )
          echo "::add-mask::$SECRET_VALUE"

Related