mirror of
https://github.com/billz/raspap-webgui.git
synced 2025-12-26 23:26:47 +01:00
Change execution to after release workflow
This commit is contained in:
20
.github/workflows/update-os-list.yml
vendored
20
.github/workflows/update-os-list.yml
vendored
@@ -2,12 +2,15 @@ name: Update OS List for RPi Imager
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
release:
|
workflow_run:
|
||||||
types: [published]
|
workflows: ["release.yaml"]
|
||||||
|
types:
|
||||||
|
- completed
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
update-os-list:
|
update-os-list:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
|
|
||||||
@@ -20,14 +23,10 @@ jobs:
|
|||||||
- name: Get release information
|
- name: Get release information
|
||||||
id: release
|
id: release
|
||||||
run: |
|
run: |
|
||||||
if [ "${{ github.event_name }}" = "release" ]; then
|
# Fetch latest release info
|
||||||
VERSION="${{ github.event.release.tag_name }}"
|
RESPONSE=$(curl -s "https://api.github.com/repos/${{ github.repository }}/releases/latest")
|
||||||
RELEASE_DATE=$(echo "${{ github.event.release.published_at }}" | cut -d'T' -f1)
|
VERSION=$(echo "$RESPONSE" | jq -r '.tag_name')
|
||||||
else
|
RELEASE_DATE=$(echo "$RESPONSE" | jq -r '.published_at' | cut -d'T' -f1)
|
||||||
RESPONSE=$(curl -s "https://api.github.com/repos/${{ github.repository }}/releases/latest")
|
|
||||||
VERSION=$(echo "$RESPONSE" | jq -r '.tag_name')
|
|
||||||
RELEASE_DATE=$(echo "$RESPONSE" | jq -r '.published_at' | cut -d'T' -f1)
|
|
||||||
fi
|
|
||||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||||
echo "release_date=$RELEASE_DATE" >> $GITHUB_OUTPUT
|
echo "release_date=$RELEASE_DATE" >> $GITHUB_OUTPUT
|
||||||
echo "Found release: $VERSION (published: $RELEASE_DATE)"
|
echo "Found release: $VERSION (published: $RELEASE_DATE)"
|
||||||
@@ -57,3 +56,4 @@ jobs:
|
|||||||
git commit -m "Update OS list for RPi Imager (${{ steps.release.outputs.version }})"
|
git commit -m "Update OS list for RPi Imager (${{ steps.release.outputs.version }})"
|
||||||
git push
|
git push
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user