2323
2424jobs :
2525 multiplatform_build :
26+ permissions :
27+ contents : read
28+ packages : write
29+ actions : read
2630 strategy :
2731 fail-fast : false
2832 matrix :
@@ -39,35 +43,40 @@ jobs:
3943 runs-on : ubuntu-24.04
4044 steps :
4145 - name : Validate
46+ env :
47+ EVENT_NAME : ${{ github.event_name }}
48+ GITHUB_REF : ${{ github.ref }}
4249 run : |
43- if [[ "${{ github.event_name }} " == "workflow_dispatch" && "${{ github.ref }} " == refs/tags* ]]; then
50+ if [[ "$EVENT_NAME " == "workflow_dispatch" && "$GITHUB_REF " == refs/tags/ * ]]; then
4451 echo -e "\033[91mManual workflow run on tags is not allowed!\033[0m"
4552 exit 1
4653 fi
4754 - name : Checkout
48- uses : actions/checkout@v4
55+ uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
56+ with :
57+ persist-credentials : false
4958 - name : Set up QEMU
50- uses : docker/setup-qemu-action@v3
59+ uses : docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0
5160 - name : Set up Docker Buildx
52- uses : docker/setup-buildx-action@v3
61+ uses : docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1
5362 - name : Login to Docker Hub
54- uses : docker/login-action@v3
63+ uses : docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
5564 with :
5665 registry : ghcr.io
5766 username : ${GITHUB_ACTOR}
5867 password : ${{secrets.GITHUB_TOKEN}}
5968 - name : Prepare Tag
6069 run : echo "TAG_NAME=$(echo ${TAG_NAME} | sed 's@refs/tags/@@;s@refs/heads/@@;s@/@_@g')" >> $GITHUB_ENV
61- - name : Get package IDs for delete
70+ - name : Get package IDs for delete
6271 id : get-ids-for-delete
63- uses : Netcracker/get-package-ids@v0.0.1
72+ uses : Netcracker/get-package-ids@84bc8eb8bed50218be76e671b3a24c35a1300979
6473 with :
6574 component-name : ${{ matrix.component.name }}
6675 component-tag : ${{ env.TAG_NAME }}
67- access-token : ${{secrets.GITHUB_TOKEN}}
76+ access-token : ${{secrets.GITHUB_TOKEN}}
6877 if : ${{ env.PUSH }}
6978 - name : Build and push
70- uses : docker/build-push-action@v6
79+ uses : docker/build-push-action@16ebe778df0e7752d2cfcbd924afdbbd89c1a755 # v6.6.1
7180 with :
7281 no-cache : true
7382 context : ${{ matrix.component.context }}
7685 push : ${{ env.PUSH }}
7786 tags : ghcr.io/netcracker/${{ matrix.component.name }}:${{ env.TAG_NAME }}
7887 provenance : false
79- - uses : actions/delete-package-versions@v5
80- with :
88+ - uses : actions/delete-package-versions@e5bc658cc4c965c472efe991f8beea3981499c55 # v5.0.0
89+ with :
8190 package-name : ${{ matrix.component.name }}
8291 package-type : ' container'
8392 package-version-ids : ${{ steps.get-ids-for-delete.outputs.ids-for-delete }}
0 commit comments