Skip to content

Commit 25ce08b

Browse files
committed
Add actual found licenses in message
1 parent ab44817 commit 25ce08b

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

.github/workflows/licensecheck.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ jobs:
123123
124124
- name: Get push type
125125
id: push-type
126-
if: ${{ steps.filter_results.outputs.filtered_results != '' }}
126+
if: ${{ steps.filter_results.outputs.filtered_results != '' }}
127127
env:
128128
COMMITCOUNT: ${{ steps.get_nr_commits.outputs.number_commits }}
129129
run: |
@@ -149,21 +149,24 @@ jobs:
149149
if: ${{ steps.filter_results.outputs.filtered_results != '' }}
150150
id: remove-license
151151
run: |
152+
jq -n --argjson data '[{"commit":"54130fa9f388c8bdcbd0284313690191469ee020","licenselines":""}]' '$data[].commit + ": " + $data[].licenselines' >> licenses_found_per_commit
153+
licenses_found_per_commit="$(cat licenses_found_per_commit)"
154+
echo "licenses_found_per_commit=$licenses_found_per_commit" >> $GITHUB_OUTPUT
152155
if ${{ steps.push-type.outputs.push_type == 'commit'}}; then
153156
echo "Removing commits as they contains licenses"
154-
git reset --hard HEAD~${{ steps.get_nr_commits.outputs.number_commits }}
155-
git push origin ${{ github.ref }} --force
156157
echo "link=https://github.com/${{ github.repository }}/commits/${{ github.ref }}" >> $GITHUB_OUTPUT
157158
echo "short_msg=push denied, reset to '${{ toJSON(github.event.before) }}'!" >> $GITHUB_OUTPUT
158159
echo "action_type=reverted to" >> $GITHUB_OUTPUT
159160
echo "msg_code=${{ github.event.before }}" >> $GITHUB_OUTPUT
161+
git reset --hard HEAD~${{ steps.get_nr_commits.outputs.number_commits }}
162+
git push origin ${{ github.ref }} --force
160163
else
161164
echo "Removing branch ${{ github.ref }} as it contains licenses"
162-
git push origin --delete ${{ github.ref }}
163165
echo "link=https://github.com/${{ github.repository }}/branches" >> $GITHUB_OUTPUT
164166
echo "short_msg='${{ github.ref }}' was removed!" >> $GITHUB_OUTPUT
165167
echo "action_type=removed" >> $GITHUB_OUTPUT
166168
echo "msg_code=${{ github.ref }}" >> $GITHUB_OUTPUT
169+
git push origin --delete ${{ github.ref }}
167170
fi
168171
169172
- name: Find correspondences
@@ -207,6 +210,13 @@ jobs:
207210
"text": "${{ steps.remove-license.outputs.action_type}} ${{ steps.push-type.outputs.push_type}} `${{ steps.remove-license.outputs.msg_code }}`"
208211
}
209212
},
213+
{
214+
"type": "section",
215+
"text": {
216+
"type": "mrkdwn",
217+
"text": "${{ steps.remove-license.outputs.licenses_found_per_commit }}"
218+
}
219+
},
210220
{
211221
"type": "section",
212222
"text": {

0 commit comments

Comments
 (0)