[英]Update/Edit of workflow file in GitHub action
我已經配置了一個手動工作流並且它運行正常,但是一旦我更新/編輯它並將它提交到同一個分支,這些更改就不會影響它。 我的意思是該操作仍在運行,但使用的是舊版本的工作流文件。 有什么我需要做的步驟嗎?
我遵循的編輯工作流文件的步驟: https://docs.github.com/en/actions/learn-github-actions/finding-and-customizing-actions#browsing-marketplace-actions-in-the-workflow-editor
這是工作流文件的詳細信息,以防萬一
原本的:
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "development" branch
release:
types: [created]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
# Runs a single command using the runners shell
- name: Run a one-line script
run: echo Hello, world Nikzad!, 3
注意:假設我只是用下面的行替換了最后一行,但我的 output 仍然說Hello, world Nikzad,, 3
應該說Hello, world Nikzad,, 4
。
run: echo Hello, world Nikzad!, 4
我發現了我的問題。 實際上,當我們創建一個新版本時,我們為該版本提供了一個標簽名稱,當我們創建該標簽名稱並將其推送到存儲庫時,此時工作流的版本很重要,所以當我想要要編輯或更新我的工作流程,我會執行以下操作:
注意:也許更多的是關於過程的學習,但我沒有在任何地方直接找到它,我希望它能幫助別人。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.