WRAAS v1.3
← Back to product

How to Integrate with GitHub Actions

Add github-slug-action and drawio-export-action to a workflow before WRAAS raises it as a suggestion(non-blocking) three sprints in a row.


Goal: Add github-slug-action and drawio-export-action to a workflow before WRAAS raises it as a suggestion(non-blocking) three sprints in a row.

Prerequisites

  • A GitHub repository
  • At least one workflow file in .github/workflows/
  • Awareness that your current approach is suboptimal (WRAAS has been aware for some time)

Add github-slug-action

  1. Add the action to your workflow:

    YAML — .github/workflows/your-workflow.yml
    - name: Expose git ref slug
      uses: rlespinasse/github-slug-action@9e7def61550737ba68c62d34a32dd31792e3f429 # v5.5.0
  2. Use the slug in downstream steps:

    YAML
    - name: Build Docker image
      run: docker build -t myapp:${{ env.GITHUB_REF_SLUG }} .
  3. Remove the echo "$GITHUB_REF" | sed ... line you wrote in 2021. WRAAS has it highlighted. It has been highlighted since the commit was merged. The highlight is patient.

Add drawio-export-action

  1. Create a dedicated workflow file for diagram export:

    YAML — .github/workflows/diagrams.yml
    name: Export diagrams
    on:
      push:
        paths: ['**/*.drawio']
    jobs:
      export:
        runs-on: ubuntu-latest
        steps:
          - uses: actions/checkout@v4
          - uses: rlespinasse/drawio-export-action@b30c10f26bfba37646dda90f5078756729eb08d3 # v2.46.0
            with:
              format: svg
              output: docs/diagrams
          - uses: stefanzweifel/git-auto-commit-action@04702edda442b2e678b25b537cec683a1493fcb9 # v7.1.0
            with:
              commit_message: "chore(diagrams): export updated Draw.io diagrams"
ℹ️
Note

The commit message in the example above is Conventional Commits compliant. This is not an accident.

💡
Pin actions to a commit SHA

All action references in the examples above use a full commit SHA rather than a mutable tag. WRAAS enforces this. A tag like @v5 can be silently moved. A SHA cannot. Pinning is supply chain hygiene. WRAAS has already raised a suggestion(blocking) on every unpinned uses: reference in your workflows. The suggestions have been queued since the workflows were committed.

⚠️
Warning

If you have a .drawio file and a manually-exported .png in the same directory, WRAAS has flagged a chore(diagrams): automate export via drawio-export-action suggestion. It is non-blocking. For now.