feat(skills): contribute CA containerization skills gated behind aksskillsEnabledPreview #2679
Workflow file for this run
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: 'PR Size Checker' | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| env: | |
| MAX_LINE_CHANGED: 1200 # Maximum number of lines changed allowed | |
| TARGET_BRANCH: main | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| actions: read | |
| contents: read | |
| deployments: read | |
| packages: none | |
| steps: | |
| # checkout your code with your git history | |
| - name: Checkout code | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| fetch-depth: 0 | |
| - id: get_total_lines_changed | |
| run: | | |
| size=$(git diff --stat origin/${{ env.TARGET_BRANCH }} \ | |
| | grep -v .lock \ | |
| | grep -v Bin \ | |
| | awk -F"|" '{ print $2 }' \ | |
| | awk '{ print $1 }' \ | |
| | sed '/^$/d' \ | |
| | paste -sd+ - \ | |
| | bc) | |
| echo "size=${size}" >> $GITHUB_ENV | |
| echo "" | |
| echo "Total lines changed (note: *.lock files are excluded from this count): " | |
| echo $size | |
| shell: bash | |
| - run: | | |
| COMMITMSG=$(git log --format=%B -n 1 ${{github.event.after}}) | |
| echo "${COMMITMSG}" | |
| if [[ $size -gt ${{ env.MAX_LINE_CHANGED }} && "${COMMITMSG}" != *"[skip pr-size]"* ]] | |
| then | |
| echo "Warning - total lines changed is greater than" ${{ env.MAX_LINE_CHANGED }}. | |
| echo "Please consider breaking this PR down." | |
| exit 1 | |
| fi | |
| shell: bash |