Update Portfolio #4
This file contains hidden or 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 Portfolio | |
| on: | |
| workflow_dispatch: | |
| release: | |
| types: [published] | |
| workflow_call: | |
| inputs: | |
| version: | |
| required: true | |
| type: string | |
| jobs: | |
| trigger-portfolio: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Get tag name (release) | |
| if: github.event_name == 'release' | |
| run: echo "TAG_NAME=${{ github.event.release.tag_name }}" >> $GITHUB_ENV | |
| - name: Get latest release tag (manual trigger) | |
| if: github.event_name == 'workflow_dispatch' | |
| run: | | |
| TAG=$(curl -s \ | |
| -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ | |
| -H "Accept: application/vnd.github+json" \ | |
| https://api.github.com/repos/${{ github.repository }}/releases/latest \ | |
| | jq -r '.tag_name') | |
| echo "TAG_NAME=$TAG" >> $GITHUB_ENV | |
| - name: Set tag from workflow_call | |
| if: github.event_name == 'workflow_call' | |
| run: echo "TAG_NAME=${{ inputs.version }}" >> $GITHUB_ENV | |
| - name: Trigger External Pipeline | |
| uses: peter-evans/repository-dispatch@v3 | |
| with: | |
| token: ${{ secrets.PAT_TOKEN }} | |
| repository: aaalloc/portfolio-2023 | |
| event-type: toy-os-release | |
| client-payload: > | |
| {"version":"${{ env.TAG_NAME }}","repository":"aaalloc/toy-os"} |