@@ -76,19 +76,23 @@ jobs:
7676
7777 - name : Remove commit/branch if licenses found
7878 if : ${{ steps.process-files.outputs.license_lines != '' }}
79- id : remove-commit
79+ id : remove-license
8080 run : |
8181 if ${{ steps.changed-files.outputs.changed_files == 'branch'}}; then
8282 BAD_COMMIT="${{ github.event.after }}"
8383 echo "Removing commit $BAD_COMMIT as it contains licenses"
8484 git reset --hard ${{ github.event.before }}
8585 git push origin ${{ github.ref }} --force-with-lease
8686 echo "bad=$BAD_COMMIT" >> $GITHUB_OUTPUT
87+ echo "link=https://github.com/${{ github.repository }}/commits/${{ github.ref }}" >> $GITHUB_OUTPUT
88+ echo "msg=${{ github.event.head_commit.message }}" >> $GITHUB_OUTPUT
8789 else
8890 BAD_BRANCH="${{ github.ref }}"
8991 echo "Removing branch $BAD_BRANCH as it contains licenses"
9092 sh "git push origin --delete ${{ github.ref }}"
9193 echo "bad=$BAD_BRANCH" >> $GITHUB_OUTPUT
94+ echo "link=https://github.com/${{ github.repository }}/branches" >> $GITHUB_OUTPUT
95+ echo "msg=" >> $GITHUB_OUTPUT
9296 fi
9397
9498 - name : Find correspondences
@@ -116,20 +120,20 @@ jobs:
116120 token : ${{ secrets.SLACK_BOT_TOKEN }}
117121 payload : |
118122 "channel": "${{ env.SLACK_USER_ID }}",
119- "text": "${{ steps.push-type.outputs.push_type }} ${{ steps.remove-commit .outputs.bad }} was removed!",
123+ "text": "${{ steps.push-type.outputs.push_type }} ${{ steps.remove-license .outputs.bad }} was removed!",
120124 "blocks": [
121125 {
122126 "type": "section",
123127 "text": {
124128 "type": "mrkdwn",
125- "text": ":alert-beam: <https://github.com/ ${{ github.repository }}/commits/${{ github.ref }}|*${{ github.repository }}> ${{ github.ref }}*>: `${{ github.sha }}` "
129+ "text": ":alert: ${{ steps.remove-license.outputs.msg) }}` ${{ steps.remove-license.outputs.bad }}` was removed! :alert: "
126130 }
127131 },
128132 {
129133 "type": "section",
130134 "text": {
131135 "type": "mrkdwn",
132- "text": ${{ toJSON(github.event.head_commit.message) }}
136+ "text": "<$link>"
133137 }
134138 }
135139 ]
0 commit comments