diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 9c53a4b..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@75699af9e26881e564e9d832ef7dc3af25ec031b # v1.2.4 + 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 13798ec..6816e26 100644 --- a/.github/workflows/release-please.yaml +++ b/.github/workflows/release-please.yaml @@ -5,14 +5,21 @@ on: branches: - main -permissions: - contents: write - pull-requests: 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@7987652d64b4581673a76e33ad5e98e3dd56832f #v4.1.3 - with: - release-type: terraform-module + uses: masterpointio/actions/.github/workflows/release-please.yaml@7dad35e85d864ca5dda0971dfd3c940cc67ed380 #v0.3.0 + with: + release-type: terraform-module + 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 1abdaf5..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@a79fd65d524d92031fe167daee411d2f25d4a999 # v0.1.0 - 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-internal" + 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 550a6d2..81da201 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -4,7 +4,7 @@ cli: plugins: sources: - id: trunk - ref: v1.7.6 + ref: v1.10.1 uri: https://github.com/trunk-io/plugins lint: enabled: @@ -16,6 +16,19 @@ lint: - markdownlint@0.48.0 - prettier@3.8.1 - trufflehog@3.94.1 + - 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: - linters: [ALL] paths: