introduction-to-github
38 строк · 859.0 Байт
1name: Step 1, Create a branch2
3on:4workflow_dispatch:5create:6
7permissions:8contents: write9
10jobs:11get_current_step:12name: Check current step number13runs-on: ubuntu-latest14steps:15- name: Checkout16uses: actions/checkout@v317- id: get_step18run: |19echo "current_step=$(cat ./.github/steps/-step.txt)" >> $GITHUB_OUTPUT
20outputs:21current_step: ${{ steps.get_step.outputs.current_step }}22
23on_create_a_branch:24name: On create a branch25needs: get_current_step26
27if: >-28${{ needs.get_current_step.outputs.current_step == 129&& github.ref_type == 'branch'30&& github.ref_name == 'my-first-branch' }}31
32runs-on: ubuntu-latest33
34steps:35- name: Checkout36uses: actions/checkout@v337with:38fetch-depth: 0 # Let's get all the branches.