loading...
Cover image for Introducing Github Action: Invite Snyk User on Issue Creation

Introducing Github Action: Invite Snyk User on Issue Creation

pierreernst profile image Pierre Ernst ・1 min read

Check out this Github Action that invites a user to Snyk. The action is triggered whenever a GitHub issue matching a title and body is created (e.g. onboarding ticket)

Snyk invite user issue action

A GitHub action to invite a user to Snyk. The action is triggered whenever a GitHub issue matching a title and body is created (e.g. onboarding ticket)

Requirements

A GitHub secret named SNYK_TOKEN must be created on the repo and contain a valid Snyk API token with enough privilege to invite users to the Snyk org.

Usage

on
  issues
    types: [opened, reopened]
jobs
  snyk_invite_job:
    runs-on: ubuntu-latest
    name: A job to invite a Snyk user 
    steps:
    - name: invite action step
      id: invite
      uses: pierre-ernst/Snyk-invite-user-issue-action@v0.1.0
      with:
        snyk-org-id: "4a18d42f-0706-4ad0-b127-24078731fbed"
        regex-title: "Issue Trigger - .+"
        regex-email: "- Email:\\s*([^\\s]+)\\s*"
        regex-checkbox: "- \\[ \\] The checkbox"  
      env:  
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}  
        SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}  
Enter fullscreen mode Exit fullscreen mode

Discussion

pic
Editor guide