-
Notifications
You must be signed in to change notification settings - Fork 155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Non-existing ENV variables are reported with ??? instead of empty value #226
Comments
yes. do it with - name: "Slack Notify: Deployment Complete"
uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001
id: slack-notify
env:
SLACK_BOT_TOKEN: ${{ inputs.SlackBotToken }}
DEPLOYRELEASEBRANCH_APPNAME: ${{ inputs.AppName }}
DEPLOYRELEASEBRANCH_APPVERSION: ${{ inputs.AppVersion }}
DEPLOYRELEASEBRANCH_ENVIRONMENT: ${{ inputs.Environment }}
DEPLOYRELEASEBRANCH_JOBNAME: ${{ inputs.JobName }}
DEPLOYRELEASEBRANCH_JOBURL: ${{ inputs.JobUrl }}
DEPLOYRELEASEBRANCH_GITHUBACTOR: ${{ inputs.GithubActor }}
with:
channel-id: ${{ inputs.SlackChannelId }}
update-ts: ${{ inputs.MessageId }}
payload-file-path: ${{ github.action_path }}/slack-notification.json |
Somewhat related, but missing |
👋 I'm finding this can use magic syntax @seratch suggested to default to empty values from the workflow file! With the latest - name: Share an update
uses: slackapi/slack-github-action@v2.0.0
with:
method: chat.postMessage
payload-file-path: ./example.json
payload-templated: true
token: ${{ secrets.SLACK_BOT_TOKEN }}
env:
COMMIT_HASH: ${{ github.sha || '' }} # This line has the blank default!
SLACK_CHANNEL_ID: ${{ secrets.SLACK_CHANNEL_ID }} With an {
"channel": "${{ env.SLACK_CHANNEL_ID }}",
"text": "A commit landed: ${{ env.COMMIT_HASH }}"
} If the This should also apply to the
Finding certain values in the GitHub context can also be a cause of confusion, and options available when replacing templatized variables are available from the default GitHub event. I'll close this issue with the workaround, but please feel free to comment with other ideas or follow up questions about this. I'm super open to ideas for enhancement here 🙏 |
Description
If a env variable which is in payload is missing, ??? are sent instead of empty value.
It would be nice to not put ??? which confuses people but leave it empty (like empty variable).
What type of issue is this? (place an
x
in one of the[ ]
)Requirements (place an
x
in each of the[ ]
)Bug Report
Filling out the following details about bugs will help us solve your issue sooner.
Reproducible in:
package version: latest
Steps to reproduce:
Expected result:
Instead of ??? I would expect missing variable to be shown just empty value (bash behavior)
Actual result:
Instead of empty, we get confusing ???
Attachments:
For example:
The text was updated successfully, but these errors were encountered: