Update product repo #33
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update product repo | |
on: | |
workflow_dispatch: | |
inputs: | |
product: | |
description: 'Product repo to update' | |
required: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- id: key | |
run: | | |
printf "name=%s_SSH_KEY\n" "$( | |
echo "${{ github.event.inputs.product }}" | | |
tr '[:lower:]-' '[:upper:]_' | |
)" >> "$GITHUB_OUTPUT" | |
- uses: actions/checkout@v3 | |
- uses: actions/checkout@v3 | |
with: | |
repository: apple-open-source/${{ github.event.inputs.product }} | |
path: ${{ github.event.inputs.product }} | |
ssh-key: ${{ secrets[steps.key.outputs.name] }} | |
- name: Update ${{ github.event.inputs.product }} repo | |
run: | | |
cd "${{ github.event.inputs.product }}" | |
ref=$(git ls-remote --tags --sort="v:refname" | tail -n1 | cut -f2) | |
git fetch origin "$ref:$ref" | |
cd .. | |
PUSH_RELEASE=1 make "${{ github.event.inputs.product }}" |