build(deps): bump github/codeql-action from 3 to 4 (#433) #1293
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: CI | |
| on: | |
| push: | |
| tags: | |
| - '*' | |
| branches: | |
| - main | |
| release: | |
| types: [published, created] | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| test: | |
| name: Test branch-names | |
| runs-on: ${{ matrix.platform }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| platform: [ubuntu-latest, windows-latest, macos-latest] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| - name: Dump GitHub context | |
| env: | |
| GITHUB_CONTEXT: ${{ toJson(github) }} | |
| run: echo "$GITHUB_CONTEXT" | |
| - name: Run test | |
| id: branch-names | |
| uses: ./ | |
| - name: Show output | |
| run: | | |
| echo "Default Branch: ${{ steps.branch-names.outputs.default_branch }}" | |
| echo "Current Branch: ${{ steps.branch-names.outputs.current_branch }}" | |
| echo "Base Ref: ${{ steps.branch-names.outputs.base_ref_branch }}" | |
| echo "Head Ref: ${{ steps.branch-names.outputs.head_ref_branch }}" | |
| echo "Ref: ${{ steps.branch-names.outputs.ref_branch }}" | |
| echo "Is Default: ${{ steps.branch-names.outputs.is_default }}" | |
| echo "Is Tag: ${{ steps.branch-names.outputs.is_tag }}" | |
| echo "Current tag: ${{ steps.branch-names.outputs.tag }}" | |
| - name: Test is_default output for pull request | |
| if: contains(github.event_name, 'pull_request') && steps.branch-names.outputs.is_tag == 'false' && steps.branch-names.outputs.is_default != 'false' | |
| run: | | |
| echo "Is default is invalid: ${{ steps.branch-names.outputs.is_default }}" | |
| exit 1 | |
| - name: Test is_default output for non pull request | |
| if: "!contains(github.event_name, 'pull_request') && steps.branch-names.outputs.is_tag == 'false' && steps.branch-names.outputs.is_default != 'true'" | |
| run: | | |
| echo "Is default is invalid: ${{ steps.branch-names.outputs.is_default }}" | |
| exit 1 | |
| - name: Test base_ref_branch output | |
| if: contains(github.event_name, 'pull_request') && steps.branch-names.outputs.is_tag == 'false' && !steps.branch-names.outputs.base_ref_branch | |
| run: | | |
| echo "Base ref unset: ${{ steps.branch-names.outputs.base_ref_branch }}" | |
| exit 1 | |
| - name: Test head_ref output | |
| if: contains(github.event_name, 'pull_request') && steps.branch-names.outputs.is_tag == 'false' && !steps.branch-names.outputs.head_ref_branch | |
| run: | | |
| echo "Head ref unset: ${{ steps.branch-names.outputs.head_ref_branch }}" | |
| exit 1 | |
| - name: Test ref_branch output | |
| if: "!steps.branch-names.outputs.ref_branch && steps.branch-names.outputs.is_tag == 'false'" | |
| run: | | |
| echo "Ref unset: ${{ steps.branch-names.outputs.ref_branch }}" | |
| exit 1 | |
| - name: Test current_branch output for pull_request or pull_request_target event. | |
| if: contains(github.event_name, 'pull_request') && steps.branch-names.outputs.is_tag == 'false' && !steps.branch-names.outputs.current_branch | |
| run: | | |
| echo "Current branch unset: ${{ steps.branch-names.outputs.current_branch }}" | |
| exit 1 | |
| - name: Test current_branch output for push event. | |
| if: github.event_name == 'push' && steps.branch-names.outputs.is_tag == 'false' && !steps.branch-names.outputs.current_branch | |
| run: | | |
| echo "Current branch unset: ${{ steps.branch-names.outputs.current_branch }}" | |
| exit 1 | |
| - name: Test current_branch output for tag based push event. | |
| if: github.event_name == 'push' && steps.branch-names.outputs.is_tag == 'true' && !steps.branch-names.outputs.base_ref_branch | |
| run: | | |
| echo "Base ref unset: ${{ steps.branch-names.outputs.base_ref_branch }}" | |
| exit 1 | |
| - name: Test tag output for tag based push event. | |
| if: github.event_name == 'push' && steps.branch-names.outputs.is_tag == 'true' && !steps.branch-names.outputs.tag | |
| run: | | |
| echo "Current tag unset: ${{ steps.branch-names.outputs.tag }}" | |
| exit 1 | |
| - name: Run test strip_branch_prefix | |
| id: branch-names-strip_branch_prefix | |
| uses: ./ | |
| with: | |
| strip_branch_prefix: 'chore/' | |
| - name: Show output | |
| run: | | |
| echo "Default Branch: ${{ steps.branch-names-strip_branch_prefix.outputs.default_branch }}" | |
| echo "Current Branch: ${{ steps.branch-names-strip_branch_prefix.outputs.current_branch }}" | |
| echo "Base Ref: ${{ steps.branch-names-strip_branch_prefix.outputs.base_ref_branch }}" | |
| echo "Head Ref: ${{ steps.branch-names-strip_branch_prefix.outputs.head_ref_branch }}" | |
| echo "Ref: ${{ steps.branch-names-strip_branch_prefix.outputs.ref_branch }}" | |
| echo "Is Default: ${{ steps.branch-names-strip_branch_prefix.outputs.is_default }}" | |
| echo "Is Tag: ${{ steps.branch-names-strip_branch_prefix.outputs.is_tag }}" | |
| echo "Current tag: ${{ steps.branch-names-strip_branch_prefix.outputs.tag }}" | |
| - name: Run test replace_slashes_with_hyphens | |
| id: branch-names-replace-slashes | |
| uses: ./ | |
| with: | |
| replace_slashes_with_hyphens: 'true' | |
| - name: Show output with replaced slashes | |
| run: | | |
| echo "Default Branch: ${{ steps.branch-names-replace-slashes.outputs.default_branch }}" | |
| echo "Current Branch: ${{ steps.branch-names-replace-slashes.outputs.current_branch }}" | |
| echo "Base Ref: ${{ steps.branch-names-replace-slashes.outputs.base_ref_branch }}" | |
| echo "Head Ref: ${{ steps.branch-names-replace-slashes.outputs.head_ref_branch }}" | |
| echo "Ref: ${{ steps.branch-names-replace-slashes.outputs.ref_branch }}" | |
| echo "Is Default: ${{ steps.branch-names-replace-slashes.outputs.is_default }}" | |
| echo "Is Tag: ${{ steps.branch-names-replace-slashes.outputs.is_tag }}" | |
| echo "Current tag: ${{ steps.branch-names-replace-slashes.outputs.tag }}" | |
| - name: Test slash replacement in branch names | |
| if: contains(github.event_name, 'pull_request') | |
| shell: bash | |
| run: | | |
| head_ref="${{ steps.branch-names-replace-slashes.outputs.head_ref_branch }}" | |
| if [[ "$head_ref" == *"/"* ]]; then | |
| echo "Slash found in head_ref_branch after replacement: $head_ref" | |
| exit 1 | |
| fi | |
| current_branch="${{ steps.branch-names-replace-slashes.outputs.current_branch }}" | |
| if [[ "$current_branch" == *"/"* ]]; then | |
| echo "Slash found in current_branch after replacement: $current_branch" | |
| exit 1 | |
| fi |