File: AzdevStyle.yml

package info (click to toggle)
azure-cli 2.82.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,359,416 kB
  • sloc: python: 1,910,381; sh: 1,343; makefile: 406; cs: 145; javascript: 74; sql: 37; xml: 21
file content (60 lines) | stat: -rw-r--r-- 2,126 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: GH Check CLI Style
on:
  pull_request_target:
    types: [opened, labeled, unlabeled, synchronize]
    branches:
      - dev

permissions: {}

jobs:
  azdev-style:
    runs-on: ubuntu-latest
    permissions:
      pull-requests: read
      contents: read
    steps:
      - name: Checkout CLI repo
        uses: actions/checkout@v4
        with:
          fetch-depth: 1
          sparse-checkout: |
            .github
      - name: Azdev Env Setup
        uses: ./.github/actions/env-setup
      - name: Get Base Branch
        env:
          bash_sha: ${{ github.event.pull_request.base.sha }}
          base_branch: ${{ github.event.pull_request.base.ref }}
          base_repo: ${{ github.event.pull_request.base.repo.clone_url }}
          base_branch_pre: "upstream"
          diff_sha: ${{ github.event.pull_request.head.sha }}
          diff_branch: ${{ github.event.pull_request.head.ref }}
          repo_full_name: ${{ github.event.pull_request.head.repo.full_name }}
        run: |
          set -x
          git --version
          git log --oneline | head -n 10
          git branch -a
          git fetch "$base_repo" "$base_branch":"$base_branch_pre"/"$base_branch"
          git checkout "$base_branch_pre"/"$base_branch"
      - name: Run Azdev Style
        env:
          pr_label_list: ${{ toJson(github.event.pull_request.labels.*.name) }}
          pr_user: ${{ github.event.pull_request.user.login }}
          base_branch: ${{ github.event.pull_request.base.ref }}
          base_branch_pre: "upstream"
          diff_branch: ${{ github.event.pull_request.head.ref }}
        run: |
          chmod +x env/bin/activate
          source ./env/bin/activate
          set -ev

          git checkout -f "$diff_branch"
          # always use the latest scripts from base branch
          git checkout "$base_branch_pre"/"$base_branch" -- scripts
          git checkout "$base_branch_pre"/"$base_branch" -- .github
          merge_base=$(git merge-base HEAD "$base_branch_pre"/"$base_branch")
          echo merge_base: "$merge_base"
          # check azdev style on diff mod 
          azdev style