add success condition and use sha for metadata job

This commit is contained in:
dkanada
2026-03-16 11:15:12 +09:00
parent e0fb23a20b
commit f540e7e86a
2 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -61,7 +61,7 @@ jobs:
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy dist --project-name=jellyfin-web --branch=${{ inputs.branch }}
command: pages deploy dist --project-name=jellyfin-web --branch="${{ inputs.branch }}"
compose-comment:
name: Compose and push comment 📝
+4 -2
View File
@@ -14,6 +14,7 @@ on:
jobs:
metadata:
name: Metadata
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
outputs:
pr_number: ${{ steps.pr_number.outputs.pr_number }}
@@ -22,9 +23,9 @@ jobs:
id: pr_number
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HEAD_BRANCH: ${{ github.event.workflow_run.head_branch }}
HEAD_SHA: ${{ github.event.workflow_run.head_sha }}
run: |
echo "pr_number=$(gh pr list --repo "${GITHUB_REPOSITORY}" --head "${HEAD_BRANCH}" --json number --jq '.[0].number')" >> "${GITHUB_OUTPUT}"
echo pr_number=$(gh api "repos/${GITHUB_REPOSITORY}/commits/${HEAD_SHA}/pulls" --jq 'map(select(.state == "open")) | .[0].number') >> "${GITHUB_OUTPUT}"
automation:
name: Automation
@@ -37,6 +38,7 @@ jobs:
deploy:
name: Deploy
if: ${{ github.event.workflow_run.conclusion == 'success' }}
uses: ./.github/workflows/__deploy.yml
permissions:
contents: read