File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed
Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Update Hangar Description
2+ on :
3+ push :
4+ branches : [ master ]
5+ jobs :
6+ update-hangar-page :
7+ runs-on : ubuntu-latest
8+
9+ steps :
10+ - name : Checkout code
11+ uses : actions/checkout@v3
12+
13+ - name : Authenticate with Hangar
14+ id : authenticate
15+ run : |
16+ RESPONSE=$(curl -s -X POST "https://hangar.papermc.io/api/v1/authenticate?apiKey=${{ secrets.HANGAR }}" -H 'accept: application/json')
17+ TOKEN=$(echo $RESPONSE | jq -r '.token')
18+ if [[ "$TOKEN" == "null" ]]; then
19+ echo "Error: Unable to fetch JWT token"
20+ exit 1
21+ fi
22+ echo "::add-mask::$TOKEN"
23+ echo "token=$TOKEN" >> $GITHUB_OUTPUT
24+
25+ - name : Update Project Description
26+ run : |
27+ README_CONTENT=$(cat README.md | jq -Rs .)
28+ curl -s -X PATCH "https://hangar.papermc.io/api/v1/pages/editmain/VelocityBlockVersion" \
29+ -H "content-type: application/json" \
30+ -H "Authorization: HangarAuth ${{ steps.authenticate.outputs.token }}" \
31+ -d "{\"content\":$README_CONTENT}"
Original file line number Diff line number Diff line change 1+ name : Update Modrinth Description
12on :
23 push :
34 branches : [ master ]
You can’t perform that action at this time.
0 commit comments