lesson-snapshot-z6GVA
64 строки · 2.1 Кб
1name: Step 0, Welcome2
3# This step triggers after the learner creates a new repository from the template.
4# This workflow updates from step 0 to step 1.
5
6# This will run every time we create push a commit to `master`.
7# Reference: https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows
8on:9workflow_dispatch:10push:11branches:12- master13
14# Reference: https://docs.github.com/en/actions/security-guides/automatic-token-authentication
15permissions:16# Need `contents: read` to checkout the repository.17# Need `contents: write` to update the step metadata.18contents: write19
20jobs:21# Get the current step to only run the main job when the learner is on the same step.22get_current_step:23name: Check current step number24runs-on: ubuntu-cloud-runner25steps:26- name: Checkout27uses: actions/checkout@v428- id: get_step29run: |30echo "current_step=$(cat ./.github/steps/-step.txt)" >> $GITHUB_OUTPUT
31outputs:32current_step: ${{ steps.get_step.outputs.current_step }}33
34on_welcome:35name: On welcome36needs: get_current_step37
38# We will only run this action when:39# 1. This repository isn't the template repository.40# 2. The step is currently 0.41# Reference: https://docs.github.com/en/actions/learn-github-actions/contexts42# Reference: https://docs.github.com/en/actions/learn-github-actions/expressions43if: >-44${{ !github.event.repository.is_template45&& needs.get_current_step.outputs.current_step == 0 }} == true46
47# We'll run Ubuntu for performance instead of Mac or Windows.48runs-on: ubuntu-cloud-runner49
50steps:51# We'll need to check out the repository so that we can edit README.md.52- name: Checkout53uses: actions/checkout@v454with:55fetch-depth: 0 # Let's get all the branches.56
57# In README.md, switch step 0 for step 1.58- name: Update to step 159uses: https://gitverse.ru/skills/action-update-step@v460with:61token: ${{ secrets.GITHUB_TOKEN }}62from_step: 063to_step: 164branch_name: my-first-branch65