diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 15eae7e..d9b071c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,10 +10,10 @@ jobs: test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - name: Set up Go - uses: actions/setup-go@v6 + uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0 with: go-version-file: 'go.mod' cache: true @@ -34,7 +34,7 @@ jobs: - name: Set up mise (Go + Bun) if: always() - uses: jdx/mise-action@v4 + uses: jdx/mise-action@e6a8b3978addb5a52f2b4cd9d91eafa7f0ab959d # v4.2.0 with: install: true diff --git a/.github/workflows/pinact.yml b/.github/workflows/pinact.yml new file mode 100644 index 0000000..e72aac5 --- /dev/null +++ b/.github/workflows/pinact.yml @@ -0,0 +1,37 @@ +name: pinact + +on: + pull_request: + paths: + - '.github/workflows/**' + - '**/action.yml' + - '**/action.yaml' + +permissions: + contents: write + +concurrency: + group: pinact-${{ github.event.pull_request.number }} + cancel-in-progress: true + +jobs: + pinact: + if: github.event.pull_request.head.repo.full_name == github.repository + runs-on: ubuntu-latest + steps: + - name: Generate GitHub App token + id: app-token + uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1 + with: + app-id: ${{ secrets.APP_ID }} + private-key: ${{ secrets.SECRET_KEY }} + + - name: Checkout + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 + with: + persist-credentials: false + + - name: Pin actions + uses: suzuki-shunsuke/pinact-action@896d595f299e71d65b9d28349d6956abe144390a # v3.0.0 + with: + github_token: ${{ steps.app-token.outputs.token }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0dae0ab..fdc7357 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,13 +17,13 @@ jobs: goreleaser: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: fetch-depth: 0 ref: ${{ github.event.release.tag_name || github.event.inputs.tag || github.ref }} - name: Set up Go - uses: actions/setup-go@v6 + uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0 with: go-version-file: 'go.mod' cache: true @@ -34,7 +34,7 @@ jobs: app-id: ${{ secrets.APP_ID }} private-key: ${{ secrets.SECRET_KEY }} - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v6 + uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0 with: distribution: goreleaser version: latest diff --git a/.github/workflows/tagpr.yml b/.github/workflows/tagpr.yml index 59814bd..08e16f2 100644 --- a/.github/workflows/tagpr.yml +++ b/.github/workflows/tagpr.yml @@ -28,7 +28,7 @@ jobs: with: app-id: ${{ secrets.APP_ID }} private-key: ${{ secrets.SECRET_KEY }} - - uses: actions/checkout@v6 + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: fetch-depth: 0 ref: main @@ -71,6 +71,6 @@ jobs: done echo "::error::commit->PR index not propagated after ~60s; failing to avoid a duplicate release PR. Re-run the workflow once GitHub recovers." exit 1 - - uses: Songmu/tagpr@v1 + - uses: Songmu/tagpr@e84001bd5dac8defa0c75b3913937d284a3b3660 # v1.20.0 env: GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}