Unable to get project Environment Variables set in project

I’m trying to integrate our build to slack and set SLACK_WEBHOOK in project Environment Variables, but seems the circleci job is unable to get the variable and report: NO SLACK WEBHOOK SET, here is the failed build and setting:


Env variables are set:

Thanks.

Hi @jay, and welcome to the CircleCI community!

To implement the Slack integration, you’ll need to:

  1. Add the Slack webhook on the Slack Integration page. (Last option in the left menu on the Project Settings page).

  2. Use the Slack orb.

Thanks @yannCI for the response.
Yes, I was using Slack Integration page to add the integration, but it’s not working:

Error message is

NO SLACK WEBHOOK SET

Here is the failed build:

Here is the configuration:

    steps:
      - checkout # check out the code in the project directory
      - run: echo "${WEBHOOK}" && echo "${SLACK_WEBHOOK}" && echo "${CIRCLE_PROJECT_REPONAME}"
      - run: cat no-exist-file
      - slack/status:
          fail_only: true
          failure_message: 'Build failed😔'
          webhook: "${SLACK_WEBHOOK}"

Hi @jay,

Apologies! I missed the build link you initially posted.

The Slack integration appears to be properly configured indeed.

However, I see that build was triggered by a forked pull-request. I suspect the issue stems from the fact that the project is not configured to pass secrets to builds from forked pull requests.

That said, I strongly advise reading about that feature before deciding to enable it.

1 Like

Yeah, that works. Thanks.

1 Like