2323 steps :
2424 - name : Docker meta
2525 id : meta
26- uses : docker/metadata-action@v5.0.0
26+ uses : docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0
2727 env :
2828 DOCKER_METADATA_PR_HEAD_SHA : true
2929 with :
@@ -35,18 +35,18 @@ jobs:
3535 type=sha
3636
3737 - name : Set up Docker Buildx
38- uses : docker/setup-buildx-action@v3
38+ uses : docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
3939
4040 - name : Login to GitHub Container Registry
41- uses : docker/login-action@v3
41+ uses : docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
4242 with :
4343 registry : ghcr.io
4444 username : ${{ github.actor }}
4545 password : ${{ secrets.GITHUB_TOKEN }}
4646
4747 - name : Build and push
4848 id : docker_build
49- uses : docker/build-push-action@v6
49+ uses : docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6.19.2
5050 with :
5151 push : true
5252 tags : ${{ steps.meta.outputs.tags }}
@@ -62,22 +62,38 @@ jobs:
6262
6363 - name : Notify team on failure
6464 if : ${{ failure() && github.ref == 'refs/heads/master' }}
65- uses : fjogeleit/http-request-action@v1
65+ uses : fjogeleit/http-request-action@551353b829c3646756b2ec2b3694f819d7957495 # v2.0.0
6666 with :
6767 url : ${{ secrets.BUILD_NOTIFICATION_URL }}
6868 method : ' POST'
6969 customHeaders : ' {"Content-Type": "application/json"}'
7070 data : ' {"content": "<a href=\"https://github.com/plausible/analytics/actions/workflows/build-private-images.yml\">Build failed</a>"}'
7171
72+ - name : Get first line and Co-Authored-By lines of the commit message
73+ if : ${{ success() && github.ref == 'refs/heads/master' }}
74+ id : commitmsg
75+ env :
76+ COMMIT_MSG : ${{ github.event.head_commit.message }}
77+ run : |
78+ first_line=$(printf '%s\n' "$COMMIT_MSG" | head -n1 | xargs)
79+ co_authors=$(printf '%s\n' "$COMMIT_MSG" | grep -h 'Co-authored-by:' | sort -u | cut -d: -f2- | paste -sd, - | xargs)
80+ {
81+ echo "first_line=$first_line"
82+ echo "co_authors=$co_authors"
83+ } >> $GITHUB_OUTPUT
84+
7285 - name : Notify team on success
7386 if : ${{ success() && github.ref == 'refs/heads/master' }}
74- uses : fjogeleit/http-request-action@v1
87+ uses : fjogeleit/http-request-action@551353b829c3646756b2ec2b3694f819d7957495 # v2.0.0
7588 with :
7689 url : ${{ secrets.BUILD_NOTIFICATION_URL }}
7790 method : ' POST'
7891 customHeaders : ' {"Content-Type": "application/json"}'
7992 escapeData : ' true'
80- data : ' {"content": "<h1>🚀 New changes are about to be deployed to production!</h1><br/><h3>👷 Author: ${{ github.actor }}</h3><br/><p>📝 Commit message: ${{ github.event.head_commit.message }}</p><br/>"}'
93+ data : |
94+ {
95+ "content": "<h1>🚀 Deploying ${{ steps.commitmsg.outputs.first_line }}</h1><p>Author(s): ${{ github.event.head_commit.author.name }}<br/>${{ steps.commitmsg.outputs.co_authors}}</p><p>Commit: <a href=\"${{ github.event.head_commit.url }}\">${{ github.sha }}</a></p>"
96+ }
8197
8298 - name : Set Honeycomb marker on success
8399 if : ${{ success() && github.ref == 'refs/heads/master' }}
0 commit comments