Skip to content

初步实现Widgets #557

初步实现Widgets

初步实现Widgets #557

name: Status Check Runner
on:
issue_comment:
types:
- created
jobs:
checkif:
runs-on: ubuntu-latest
name: Check Comment Content
outputs:
shouldc: ${{ steps.checkc.outputs.shouldc }}
shouldtun: ${{ steps.checkc.outputs.shouldtun }}
shouldtui: ${{ steps.checkc.outputs.shouldtui }}
steps:
- name: Check
id: checkc
run: |
if [[ "${{ github.event.comment.body }}" != *"!Run check"* ]]; then
echo "The comment content does not contain the specified text. Cancelling workflow."
echo "::set-output name=shouldc::false"
else
echo "The comment content contains the specified text. Continuing with further actions."
echo "::set-output name=shouldc::true"
fi
if [[ "${{ github.event.comment.body }}" != *"!Export IPA"* ]]; then
echo "::set-output name=shouldtun::false"
else
echo "::set-output name=shouldtun::true"
fi
if [[ "${{ github.event.comment.body }}" != *"!Deploy TF"* ]]; then
echo "::set-output name=shouldtui::false"
else
echo "::set-output name=shouldtui::true"
fi
get-head-sha:
name: Get Pull Request Head SHA
needs: checkif
if: ${{ needs.checkif.outputs.shouldc == 'true' || needs.checkif.outputs.shouldtun == 'true' || needs.checkif.outputs.shouldtui == 'true' }}
runs-on: ubuntu-latest
outputs:
psha: ${{ steps.getsha.outputs.psha }}
repository: ${{ steps.getsha.outputs.repository }}
lsha: ${{ steps.getsha.outputs.lsha }}
env:
slink: ${{ github.event.issue.pull_request.url }}
steps:
- name: Get SHA
id: getsha
run: |
json_data=$(curl -s "$slink")
sha=$(echo "$json_data" | jq -r '.head.ref')
repo=$(echo "$json_data" | jq -r '.head.repo.full_name')
lsha=$(echo "$json_data" | jq -r '.head.sha')
echo "psha=$sha" >> $GITHUB_OUTPUT
echo "repository=$repo" >> $GITHUB_OUTPUT
echo "lsha=$lsha" >> $GITHUB_OUTPUT
call-check-workflow:
name: Call Check Overflow
needs:
- get-head-sha
- checkif
if: ${{ needs.checkif.outputs.shouldc == 'true' }}
permissions:
actions: write
runs-on: ubuntu-latest
steps:
- name: Call
uses: benc-uk/[email protected]
with:
workflow: status-check.yml
inputs: '{ "psha": "${{ needs.get-head-sha.outputs.psha }}", "repository": "${{ needs.get-head-sha.outputs.repository }}", "lsha": "${{ needs.get-head-sha.outputs.lsha }}" }'
call-company-export-workflow:
name: Call Company Export Overflow
needs:
- get-head-sha
- checkif
if: ${{ needs.checkif.outputs.shouldtun == 'true' }}
permissions:
actions: write
runs-on: ubuntu-latest
steps:
- name: Call
uses: benc-uk/[email protected]
with:
workflow: company-export.yml
inputs: '{ "psha": "${{ needs.get-head-sha.outputs.psha }}", "repository": "${{ needs.get-head-sha.outputs.repository }}", "lsha": "${{ needs.get-head-sha.outputs.lsha }}" }'
call-tf-deploy-workflow:
name: Call TestFlight Internal Deploy Overflow
needs:
- get-head-sha
- checkif
if: ${{ needs.checkif.outputs.shouldtui == 'true' }}
permissions:
actions: write
runs-on: ubuntu-latest
steps:
- name: Call
uses: benc-uk/[email protected]
with:
workflow: tf.yml
inputs: '{ "psha": "${{ needs.get-head-sha.outputs.psha }}", "repository": "${{ needs.get-head-sha.outputs.repository }}", "lsha": "${{ needs.get-head-sha.outputs.lsha }}" }'