Skip to content

Shared environment variables can cause multiple techniques to match which errors #373

@zimeg

Description

@zimeg

Description

Setting either the SLACK_TOKEN or SLACK_WEBHOOK_URL environment variables for all steps in a workflow, then creating a step with an opposite technique, causes the step to fail despite the input seeming correct. Noted here: #372 (comment)

What type of issue is this?

  • bug

Requirements

  • I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've searched for any related issues and avoided creating a duplicate issue.

Bug Report

Steps to reproduce:

jobs:
  run:
    runs-on: ubuntu-latest
    env:
      SLACK_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
    steps:
      - name: Start a workflow with a webhook trigger
        uses: slackapi/slack-github-action@v2.0.0
        with:
          errors: true
          webhook: ${{ secrets.SLACK_WEBHOOK_TRIGGER }}
          webhook-type: webhook-trigger
          payload: |
            author: ${{ github.event.sender.login }}

Expected result:

The provided webhook input to be used!

Actual result:

SlackError: Invalid input! Either the token or webhook is required - not both.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions