custom action to send approval request to Slack
- Post a message in Slack with a "Aoorove" and "Reject" buttons.
 - Clicking on "Approve" will execute next steps.
 - Clicking on "Reject" will cause workflow to fail.
 
- First, create a Slack App and install in your workspace.
 - Second, add 
chat:writeandim:writeto OAuth Scope on OAuth & Permissions page. - Finally, Enable Socket Mode.
 
jobs:
  approval:
    runs-on: ubuntu-latest
    steps:
      - name: send approval
        uses: varu3/slack-approval@main
        env:
          SLACK_APP_TOKEN: ${{ secrets.SLACK_APP_TOKEN }}
          SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
          SLACK_SIGNING_SECRET: ${{ secrets.SLACK_SIGNING_SECRET }}
          SLACK_CHANNEL_ID: ${{ secrets.SLACK_CHANNEL_ID }}
        timeout-minutes: 10- 
Set environment variables
- 
SLACK_APP_TOKEN- App-level tokens on 
Basic Information page. (starting withxapp-) 
 - App-level tokens on 
 - 
SLACK_BOT_TOKEN- Bot-level tokens on 
OAuth & Permissions page. (starting withxoxb-) 
 - Bot-level tokens on 
 - 
SLACK_SIGNING_SECRET- Signing Secret on 
Basic Information page. 
 - Signing Secret on 
 - 
SLACK_CHANNEL_ID- Channel ID for which you want to send approval.
 
 
 - 
 - 
Set
timeout-minutes- Set the time to wait for approval. If the timeout is reached, GitHub Actions will forcefully terminate the workflow.
 
 
You can add custom blocks to the Slack notification by using the custom-blocks input:
jobs:
  approval:
    runs-on: ubuntu-latest
    steps:
      - name: send approval
        uses: varu3/slack-approval@main
        with:
          custom-blocks: |
            [
              {
                "type": "section",
                "text": {
                  "type": "mrkdwn",
                  "text": "*Environment:* Production"
                }
              }
            ]
        env:
          SLACK_APP_TOKEN: ${{ secrets.SLACK_APP_TOKEN }}
          SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
          SLACK_SIGNING_SECRET: ${{ secrets.SLACK_SIGNING_SECRET }}
          SLACK_CHANNEL_ID: ${{ secrets.SLACK_CHANNEL_ID }}
        timeout-minutes: 10The custom blocks will be displayed after the workflow information and before the Approve/Reject buttons. You can use any valid Slack Block Kit blocks.