From f322354f41e1227f51b20e44d675ccdcc6a25634 Mon Sep 17 00:00:00 2001 From: Gerry Laracuente Date: Mon, 8 Jun 2026 12:32:54 -0400 Subject: [PATCH] chore: zizmor trunk plugin and reusable workflows (INT-1582) --- .github/workflows/lint.yaml | 22 ++++++++++----------- .github/workflows/release-please.yaml | 24 ++++++++++++++--------- .github/workflows/trunk-upgrade.yaml | 28 ++++++++++++--------------- .trunk/trunk.yaml | 15 +++++++++++++- 4 files changed, 52 insertions(+), 37 deletions(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 61445a2..524c89f 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -2,17 +2,17 @@ name: Lint on: pull_request -permissions: - actions: read - checks: write - contents: read - pull-requests: read +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} + cancel-in-progress: true + +permissions: {} jobs: lint: - runs-on: ubuntu-latest - steps: - - name: Check out Git repository - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - name: Trunk Check - uses: trunk-io/trunk-action@04ba50e7658c81db7356da96657e6e77f220bfa3 # v1.3.1 + uses: masterpointio/actions/.github/workflows/lint.yaml@7dad35e85d864ca5dda0971dfd3c940cc67ed380 #v0.3.0 + permissions: + actions: read # for trunk-action + checks: write # for trunk-action + contents: read # for trunk-action + checkout + pull-requests: read # for action-semantic-pull-request diff --git a/.github/workflows/release-please.yaml b/.github/workflows/release-please.yaml index b832f68..86127f1 100644 --- a/.github/workflows/release-please.yaml +++ b/.github/workflows/release-please.yaml @@ -5,15 +5,21 @@ on: branches: - main -permissions: - contents: write - pull-requests: write - issues: write +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} + cancel-in-progress: true + +permissions: {} jobs: release-please: - runs-on: ubuntu-latest - steps: - - uses: googleapis/release-please-action@5c625bfb5d1ff62eadeeb3772007f7f66fdcf071 # v4.4.1 - with: - release-type: simple + uses: masterpointio/actions/.github/workflows/release-please.yaml@7dad35e85d864ca5dda0971dfd3c940cc67ed380 #v0.3.0 + with: + release-type: simple + secrets: + MP_BOT_APP_ID: ${{ secrets.MP_BOT_APP_ID }} + MP_BOT_APP_PRIVATE_KEY: ${{ secrets.MP_BOT_APP_PRIVATE_KEY }} + permissions: + contents: write # needed by release-please-action + pull-requests: write # needed by release-please-action + issues: write # needed by release-please-action diff --git a/.github/workflows/trunk-upgrade.yaml b/.github/workflows/trunk-upgrade.yaml index bce47d8..716951f 100644 --- a/.github/workflows/trunk-upgrade.yaml +++ b/.github/workflows/trunk-upgrade.yaml @@ -6,23 +6,19 @@ on: - cron: 0 8 1 * * workflow_dispatch: {} -permissions: read-all +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} + cancel-in-progress: true + +permissions: {} jobs: trunk-upgrade: - runs-on: ubuntu-latest + uses: masterpointio/actions/.github/workflows/trunk-upgrade.yaml@7dad35e85d864ca5dda0971dfd3c940cc67ed380 #v0.3.0 + secrets: + MP_BOT_APP_ID: ${{ secrets.MP_BOT_APP_ID }} + MP_BOT_APP_PRIVATE_KEY: ${{ secrets.MP_BOT_APP_PRIVATE_KEY }} + MASTERPOINT_TEAM_PAT: ${{ secrets.MASTERPOINT_TEAM_PAT }} permissions: - # For trunk to create PRs - contents: write - pull-requests: write - steps: - - name: Checkout - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - - name: Run Trunk Upgrade - uses: masterpointio/github-action-trunk-upgrade@5829528076cea6cedbba2f3b77734034295724db # v0.1.1 - with: - app-id: ${{ secrets.MP_BOT_APP_ID }} - app-private-key: ${{ secrets.MP_BOT_APP_PRIVATE_KEY }} - github-token: ${{ secrets.MASTERPOINT_TEAM_PAT }} - reviewers: "@masterpointio/masterpoint-open-source" + contents: write # needed by github-action-trunk-upgrade + pull-requests: write # needed by github-action-trunk-upgrade diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index d86a9b9..aa738e4 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -7,7 +7,7 @@ cli: plugins: sources: - id: trunk - ref: v1.10.0 + ref: v1.10.1 uri: https://github.com/trunk-io/plugins # Many linters and tools depend on runtimes - configure them here. (https://docs.trunk.io/runtimes) runtimes: @@ -24,6 +24,19 @@ lint: - prettier@3.8.3 - trufflehog@3.95.3 - yamllint@1.38.0 + - zizmor@1.25.2 + definitions: + - name: zizmor + environment: + # Optional token here so that it's not needed locally, but can be used + # when trunk is called from our lint workflow in GHA + - name: ZIZMOR_GITHUB_TOKEN + value: ${env.GITHUB_TOKEN} + optional: true + commands: + # Set to pedantic so that zizmor will run its stale-action-refs audit rule + - name: lint + run: zizmor --format=sarif --persona=pedantic ${target} ignore: # Ignore CHANGELOG.md as release-please manages this file - linters: [ALL]