Skip to content

Commit 227728f

Browse files
committed
TWEAK
1 parent 135bc60 commit 227728f

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

.github/workflows/licensecheck.yml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -53,20 +53,17 @@ jobs:
5353
run: echo "${{ steps.license-lines.outputs.license_lines }}"
5454

5555
- name: Remove commit if licenses found
56+
if: ${{ steps.license-lines.outputs.license_lines != '' }}
5657
id: remove-commit
5758
run: |
58-
BAD_COMMIT=''
59-
if ${{ steps.license-lines.outputs.license_lines != '' }}; then
60-
BAD_COMMIT="${{ github.event.after }}"
61-
echo "Removing commit $BAD_COMMIT as it contains licenses"
62-
git reset --hard ${{ github.event.before }}
63-
git push origin ${{ github.ref }} --force-with-lease
64-
else
65-
echo "NOT Removing commit"
66-
fi
59+
BAD_COMMIT="${{ github.event.after }}"
60+
echo "Removing commit $BAD_COMMIT as it contains licenses"
61+
git reset --hard ${{ github.event.before }}
62+
git push origin ${{ github.ref }} --force-with-lease
6763
echo "bad_commit=$BAD_COMMIT" >> $GITHUB_OUTPUT
6864
6965
- name: Find correspondences
66+
if: ${{ steps.license-lines.outputs.license_lines != '' }}
7067
id: email
7168
uses: slackapi/[email protected]
7269
with:
@@ -90,13 +87,13 @@ jobs:
9087
token: ${{ secrets.SLACK_BOT_TOKEN }}
9188
payload: |
9289
"channel": "${{ env.SLACK_USER_ID }}",
93-
"text": "${{ github.repository }} had a change!",
90+
"text": "Commit ${{ steps.remove-commit.outputs.bad_commit }} was removed!",
9491
"blocks": [
9592
{
9693
"type": "section",
9794
"text": {
9895
"type": "mrkdwn",
99-
"text": ":large_green_square: <https://github.com/${{ github.repository }}|*${{ github.repository }}*>: `${{ github.sha }}`"
96+
"text": ":alert-beam: <https://github.com/${{ github.repository }}/commits/${{ github.ref }}|*${{ github.repository }}>${{ github.ref }}*>: `${{ github.sha }}`"
10097
}
10198
},
10299
{
@@ -107,4 +104,3 @@ jobs:
107104
}
108105
}
109106
]
110-

0 commit comments

Comments
 (0)