|
13 | 13 | # limitations under the License. |
14 | 14 |
|
15 | 15 | permissions: |
16 | | - contents: read # This is required for actions/checkout |
| 16 | + contents: read # This is required for actions/checkout |
17 | 17 | name: pipeline |
18 | 18 | on: |
19 | | - push: |
20 | | - tags: |
21 | | - - v* |
22 | | - branches: |
23 | | - - main |
24 | | - pull_request: |
| 19 | + push: |
| 20 | + tags: |
| 21 | + - v* |
| 22 | + branches: |
| 23 | + - main |
| 24 | + pull_request: |
25 | 25 | jobs: |
26 | | - fmt: |
27 | | - uses: ./.github/workflows/witness.yml |
28 | | - permissions: |
29 | | - id-token: write # This is required for requesting the JWT |
30 | | - contents: read # This is required for actions/checkout |
31 | | - with: |
32 | | - pull_request: ${{ github.event_name == 'pull_request' }} |
33 | | - step: static-analysis |
34 | | - attestations: "github" |
35 | | - command: go fmt ./... |
| 26 | + fmt: |
| 27 | + uses: ./.github/workflows/witness.yml |
| 28 | + permissions: |
| 29 | + id-token: write # This is required for requesting the JWT |
| 30 | + contents: read # This is required for actions/checkout |
| 31 | + with: |
| 32 | + pull_request: ${{ github.event_name == 'pull_request' }} |
| 33 | + step: static-analysis |
| 34 | + attestations: "github" |
| 35 | + command: go fmt ./... |
36 | 36 |
|
37 | | - static_analysis: |
38 | | - uses: ./.github/workflows/witness.yml |
39 | | - permissions: |
40 | | - id-token: write # This is required for requesting the JWT |
41 | | - contents: read # This is required for actions/checkout |
42 | | - with: |
43 | | - pull_request: ${{ github.event_name == 'pull_request' }} |
44 | | - step: static-analysis |
45 | | - attestations: "github" |
46 | | - command: go vet ./... |
| 37 | + static_analysis: |
| 38 | + uses: ./.github/workflows/witness.yml |
| 39 | + permissions: |
| 40 | + id-token: write # This is required for requesting the JWT |
| 41 | + contents: read # This is required for actions/checkout |
| 42 | + with: |
| 43 | + pull_request: ${{ github.event_name == 'pull_request' }} |
| 44 | + step: static-analysis |
| 45 | + attestations: "github" |
| 46 | + command: go vet ./... |
47 | 47 |
|
48 | | - tests: |
49 | | - needs: [fmt, static_analysis] |
50 | | - uses: ./.github/workflows/witness.yml |
51 | | - permissions: |
52 | | - id-token: write # This is required for requesting the JWT |
53 | | - contents: read # This is required for actions/checkout |
54 | | - with: |
55 | | - pull_request: ${{ github.event_name == 'pull_request' }} |
56 | | - step: "tests" |
57 | | - attestations: "github" |
58 | | - command: | |
59 | | - make clean |
60 | | - make test |
| 48 | + tests: |
| 49 | + needs: [fmt, static_analysis] |
| 50 | + uses: ./.github/workflows/witness.yml |
| 51 | + permissions: |
| 52 | + id-token: write # This is required for requesting the JWT |
| 53 | + contents: read # This is required for actions/checkout |
| 54 | + with: |
| 55 | + pull_request: ${{ github.event_name == 'pull_request' }} |
| 56 | + step: "tests" |
| 57 | + attestations: "github" |
| 58 | + command: | |
| 59 | + make clean |
| 60 | + make test |
61 | 61 |
|
62 | | - release: |
63 | | - needs: tests |
64 | | - permissions: |
65 | | - id-token: write |
66 | | - contents: write |
67 | | - packages: write |
68 | | - runs-on: ubuntu-latest |
69 | | - if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') |
| 62 | + release: |
| 63 | + needs: tests |
| 64 | + permissions: |
| 65 | + id-token: write |
| 66 | + contents: write |
| 67 | + packages: write |
| 68 | + runs-on: ubuntu-latest |
| 69 | + if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') |
70 | 70 |
|
71 | | - steps: |
72 | | - - name: Harden Runner |
73 | | - uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4 |
74 | | - with: |
75 | | - egress-policy: audit |
| 71 | + steps: |
| 72 | + - name: Harden Runner |
| 73 | + uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4 |
| 74 | + with: |
| 75 | + egress-policy: audit |
76 | 76 |
|
77 | | - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
78 | | - - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 |
79 | | - with: |
80 | | - go-version-file: "go.mod" |
| 77 | + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 78 | + with: |
| 79 | + persist-credentials: false |
| 80 | + - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 |
| 81 | + with: |
| 82 | + go-version-file: "go.mod" |
| 83 | + cache: false |
81 | 84 |
|
82 | | - - name: Login to GitHub Container Registry |
83 | | - uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0 |
84 | | - with: |
85 | | - registry: ghcr.io |
86 | | - username: ${{ github.actor }} |
87 | | - password: ${{ secrets.GITHUB_TOKEN }} |
| 85 | + - name: Login to GitHub Container Registry |
| 86 | + uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0 |
| 87 | + with: |
| 88 | + registry: ghcr.io |
| 89 | + username: ${{ github.actor }} |
| 90 | + password: ${{ secrets.GITHUB_TOKEN }} |
88 | 91 |
|
89 | | - - name: Set up QEMU |
90 | | - uses: docker/setup-qemu-action@v4 |
| 92 | + - name: Set up QEMU |
| 93 | + uses: docker/setup-qemu-action@06116385d9baf250c9f4dcb4858b16962ea869c3 # v4.1.0 |
91 | 94 |
|
92 | | - - name: Set up Docker Buildx |
93 | | - uses: docker/setup-buildx-action@v4 |
| 95 | + - name: Set up Docker Buildx |
| 96 | + uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4.1.0 |
94 | 97 |
|
95 | | - - name: Download GoReleaser |
96 | | - run: go install github.com/goreleaser/goreleaser@v1.23.0 |
| 98 | + - name: Download GoReleaser |
| 99 | + run: go install github.com/goreleaser/goreleaser@v1.23.0 |
97 | 100 |
|
98 | | - - name: Run GoReleaser |
99 | | - uses: testifysec/witness-run-action@7aa15e327829f1f2a523365c564c948d5dde69dd |
100 | | - env: |
101 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
102 | | - GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }} |
103 | | - with: |
104 | | - witness-install-dir: /opt/witness |
105 | | - version: 0.9.1 |
106 | | - step: "build" |
107 | | - attestations: "github" |
108 | | - command: goreleaser release --clean |
| 101 | + - name: Run GoReleaser |
| 102 | + uses: testifysec/witness-run-action@7aa15e327829f1f2a523365c564c948d5dde69dd |
| 103 | + env: |
| 104 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 105 | + GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }} |
| 106 | + with: |
| 107 | + witness-install-dir: /opt/witness |
| 108 | + version: 0.9.1 |
| 109 | + step: "build" |
| 110 | + attestations: "github" |
| 111 | + command: goreleaser release --clean |
0 commit comments