Add license check and issue creation for Homebrewery license changes
This commit is contained in:
parent
b708c21085
commit
36c616d665
9
.gitea/ISSUE_LICENSE_CHANGED.md
Normal file
9
.gitea/ISSUE_LICENSE_CHANGED.md
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
title: License of upstream Homebrewery has changed
|
||||||
|
assignees: f.weber
|
||||||
|
labels: bug
|
||||||
|
---
|
||||||
|
|
||||||
|
It seems that [naturalcrit/homebrewery](https://github.com/naturalcrit/homebrewery) is not using the MIT license anymore.
|
||||||
|
|
||||||
|
We have to check that and if we are still allowed to use their project.
|
@ -17,7 +17,19 @@ jobs:
|
|||||||
update:
|
update:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
|
- name: Check current license
|
||||||
|
run: |
|
||||||
|
resp=$(curl -sSf \
|
||||||
|
-H "Accept: application/vnd.github.v3+json" \
|
||||||
|
-H "Authorization: token ${{ secrets.GH_TOKEN }}" \
|
||||||
|
https://api.github.com/repos/naturalcrit/homebrewery)
|
||||||
|
|
||||||
|
license=$(echo "$resp" | jq -r .license.spdx_id)
|
||||||
|
|
||||||
|
echo "LICENSE=$license" >>"$GITHUB_ENV"
|
||||||
|
|
||||||
- name: Get latest Homebrewery release via GitHub API
|
- name: Get latest Homebrewery release via GitHub API
|
||||||
|
if: ${{ env.license == 'MIT' }}
|
||||||
run: |
|
run: |
|
||||||
resp=$(curl -sSf \
|
resp=$(curl -sSf \
|
||||||
-H "Accept: application/vnd.github.v3+json" \
|
-H "Accept: application/vnd.github.v3+json" \
|
||||||
@ -27,7 +39,7 @@ jobs:
|
|||||||
id=$( echo "$resp" | jq -r .id)
|
id=$( echo "$resp" | jq -r .id)
|
||||||
tag_name=$( echo "$resp" | jq -r .tag_name)
|
tag_name=$( echo "$resp" | jq -r .tag_name)
|
||||||
name=$( echo "$resp" | jq -r .name)
|
name=$( echo "$resp" | jq -r .name)
|
||||||
url=$( echo "$resp" | jq -r .url)
|
url=$( echo "$resp" | jq -r .html_url)
|
||||||
draft=$( echo "$resp" | jq -r .draft)
|
draft=$( echo "$resp" | jq -r .draft)
|
||||||
prerelease=$( echo "$resp" | jq -r .prerelease)
|
prerelease=$( echo "$resp" | jq -r .prerelease)
|
||||||
body_text=$( echo "$resp" | jq -r .body)
|
body_text=$( echo "$resp" | jq -r .body)
|
||||||
@ -47,11 +59,12 @@ jobs:
|
|||||||
printf '\n'
|
printf '\n'
|
||||||
printf '%s\n' "$body_text"
|
printf '%s\n' "$body_text"
|
||||||
printf '\n'
|
printf '\n'
|
||||||
printf '%s\n' "See original Changelog from [$name]($html_url)"
|
printf '%s\n' "See original Changelog from [$name]($url)"
|
||||||
echo "EOF"
|
echo "EOF"
|
||||||
} >>"$GITHUB_ENV"
|
} >>"$GITHUB_ENV"
|
||||||
|
|
||||||
- name: Debug step
|
- name: Debug step
|
||||||
|
if: ${{ env.license == 'MIT' }}
|
||||||
run: |
|
run: |
|
||||||
echo "id: $ID"
|
echo "id: $ID"
|
||||||
echo "draft: $DRAFT"
|
echo "draft: $DRAFT"
|
||||||
@ -62,10 +75,19 @@ jobs:
|
|||||||
|
|
||||||
- name: Create Docker Release
|
- name: Create Docker Release
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
if: ${{ env.ID > 0 && env.DRAFT != 'true' }}
|
if: ${{ env.license == 'MIT' && env.ID > 0 && env.DRAFT != 'true' }}
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GT_UPDATE_TOKEN }}
|
token: ${{ secrets.GT_UPDATE_TOKEN }}
|
||||||
prerelease: ${{ env.PRERELEASE }}
|
prerelease: ${{ env.PRERELEASE }}
|
||||||
name: ${{ env.NAME }}
|
name: ${{ env.NAME }}
|
||||||
tag_name: ${{ env.TAG_NAME }}
|
tag_name: ${{ env.TAG_NAME }}
|
||||||
body: ${{ env.RELEASE_BODY }}
|
body: ${{ env.RELEASE_BODY }}
|
||||||
|
|
||||||
|
- name: Create License changed issue
|
||||||
|
uses: JasonEtco/create-an-issue@v2
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GT_UPDATE_TOKEN }}
|
||||||
|
with:
|
||||||
|
update_existing: true
|
||||||
|
search_existing: open
|
||||||
|
filename: .gitea/ISSUE_LICENSE_CHANGED.md
|
||||||
|
Loading…
x
Reference in New Issue
Block a user