docs(cicd-ex2-2): switch to fork workflow and shrink the code change #31
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: Repo Info | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| jobs: | |
| fetch-info: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Fetch repository info | |
| env: | |
| REPO: ${{ github.repository }} | |
| run: curl -s "https://api.github.com/repos/${REPO}" > repo.json | |
| - name: Show repository name | |
| run: jq -r .full_name repo.json | |
| - name: Show star count | |
| run: | | |
| STARS=$(jq -e .stargazers_count repo.json) | |
| echo "This repo has $STARS stars" | |
| - name: Show description | |
| run: jq -r .description repo.json |