Michael Born
Web developer at Ortus Solutions
Github Actions is an event-driven automation tool for github repositories, and utilizes open-source "Actions" for condensed, reusable configuration
GA makes it simple to:
The workflow is an automated procedure that you add to your repository. Workflows are made up of one or more jobs and can be scheduled or triggered by an event. The workflow can be used to build, test, package, release, or deploy a project on GitHub.
Actions are standalone commands that are combined into steps to create a job. Actions are the smallest portable building block of a workflow. You can create your own actions, or use actions created by the GitHub community.
Github Marketplace is a public search directory for shared actions.
What would a CFFormat workflow look like?
on: pull_request
jobs:
  format:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Repository
        uses: actions/checkout@v2
      - name: Setup Java
        uses: actions/setup-java@v2
        with:
          distribution: "adopt"
          java-version: "11"
      - name: Set Up CommandBox
        uses: elpete/setup-commandbox@v1.0.0
      - name: Install CFFormat
        run: box install commandbox-cfformat
      - name: Run CFFormat
        run: box cfformat run path=models,tests/specs --overwrite
      - name: Commit Format Changes
        uses: stefanzweifel/git-auto-commit-action@v4
        with:
          commit_message: "👌 IMPROVE: Auto-format cfcs via cfformat"So Slow!
So Much Config!
So Complex!
Instead of this:
Do this:
steps:
  - uses: Ortus-Solutions/commandbox-action@v1
    with:
      cmd: cfformat run models,handlers,tests/specs --overwritesteps:
  - uses: Ortus-Solutions/semantic-release-action@v1
    with:
      githubToken: ${{ secrets.GH_TOKEN }}
      excludeCommit: ${{ github.event.head_commit.message }}
      forgeboxToken: ${{ secrets.FORGEBOX_TOKEN }}
      branch: mainsteps:
  - name: Run Fixinator Security Scan
    uses: Ortus-Solutions/fixinator-action@v1
    with:
      api_key: ${{ secrets.FIXINATOR_KEY }}
      path: ModuleConfig.cfc,models
      confidence: medium
      severity: lowsteps:
  - name: Run tests
    uses: Ortus-Solutions/testbox-action
    with:
      cfengine: lucee@5.3.8name: CFFormat
on: [push, pull_request]
jobs:
  format:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repo
        uses: actions/checkout@v2
      
      - name: Run CFFormat
        uses: Ortus-Solutions/commandbox-action@v1
        with:
          cmd: cfformat run path=models,tests/specs --overwrite
      
      - name: Commit Format Changes
        uses: stefanzweifel/git-auto-commit-action@v4
        with:
          commit_message: "👌 IMPROVE: Auto-format cfcs via cfformat"name: DocBox
on: [push, pull_request]
jobs:
  format:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Repo
        uses: actions/checkout@v2
      
      - name: Generate Docs
        uses: Ortus-Solutions/commandbox-action@v1
        with:
          cmd: docbox generate mapping=cfPlaid excludes=test|ModuleConfig strategy-outputDir=docs strategy-projectTitle=cfPlaid
      
      - name: Commit Docs to Repo
        uses: stefanzweifel/git-auto-commit-action@v4
        with:
          commit_message: "📖 DOC: Auto-generate DocBox API docs"name: Fixinator
on: [push, pull_request]
jobs:
  audit:
    name: Fixinator
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Repo
        uses: actions/checkout@v2
      
      - name: Run Fixinator Security Scan
        uses: Ortus-Solutions/fixinator-action@v1
        with:
          api_key: ${{ secrets.FIXINATOR_KEY }}
          path: ModuleConfig.cfc,models
          confidence: medium
          severity: lowname: Fixinator
on: [push, pull_request]
jobs:
  release:
    name: Semantic Release
    if: "!contains(github.event.head_commit.message, '__SEMANTIC RELEASE VERSION UPDATE__')"
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repo
        uses: actions/checkout@v2
      - name: Push new Release
        uses: Ortus-Solutions/semantic-release-action@v1
        with:
          githubToken: ${{ secrets.GH_TOKEN }}
          excludeCommit: ${{ github.event.head_commit.message }}
          forgeboxToken: ${{ secrets.FORGEBOX_TOKEN }}
          branch: main@michaelborn_me
DM me your GitHub repo on Twitter.
I'll PR a GitHub Actions workflow
By Michael Born