我正在尝试origin从 GitHub 操作推送到远程。我的行动逻辑是:
pull_request_review事件并按评论消息过滤originThe script is:
if [[ "${GITHUB_EVENT_NAME}" != "pull_request_review" ]]; then
echo "unsupported event: ${GITHUB_EVENT_NAME}"
exit 1
fi
user=$(jq -r .review.user.login ${GITHUB_EVENT_PATH})
cmd=$(jq -r .review.body ${GITHUB_EVENT_PATH})
echo "reviewer is ${user}, command is ${cmd}"
if [[ "${cmd}" == "merge" ]]; then
head=$(jq -r .pull_request.head.ref ${GITHUB_EVENT_PATH})
git config user.email test@test.com
git config user.name test
git checkout -B _tmp origin/${head}
git checkout …Run Code Online (Sandbox Code Playgroud) 我正在尝试构建一个 GitHub 工作流,该工作流将在另一个存储库创建新版本时触发。
在文档中,有一段:on.event_name.typeswhere event_namewill be release。
问题是:有没有办法引用release另一个存储库的事件?
我创建了工作流程Test,但没有Run workflow手动运行它的按钮。
这是我的test.yml文件。有什么遗漏吗?
name: Test
on:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run a one-line script
run: echo Hello, world!
Run Code Online (Sandbox Code Playgroud) 在 Maven 中,我需要提供项目中目录的绝对路径。如何获取 GitHub 操作运行目录的绝对路径?
我目前正在创建一个复合 GitHub Actions,它从 Java 项目构建 JavaDoc,并使用 GitHub Page 自动将其发布到静态页面。
但是当我尝试运行它时出现此错误:
Current runner version: '2.287.1'
Operating System
Virtual Environment
Virtual Environment Provisioner
GITHUB_TOKEN Permissions
Secret source: Actions
Prepare workflow directory
Prepare all required actions
Getting action download info
Download action repository 'MathieuSoysal/Javadoc-publisher.yml@v2.0.2' (SHA:878c07f835dd9bcbb8800090d109c91b0f0d4581)
Error: MathieuSoysal/Javadoc-publisher.yml/v2.0.2/action.yml (Line: 29, Col: 5): Required property is missing: shell
Error: MathieuSoysal/Javadoc-publisher.yml/v2.0.2/action.yml (Line: 29, Col: 5): Required property is missing: shell
Error: GitHub.DistributedTask.ObjectTemplating.TemplateValidationException: The template is not valid. MathieuSoysal/Javadoc-publisher.yml/v2.0.2/action.yml (Line: 29, Col: 5): Required property …Run Code Online (Sandbox Code Playgroud) 我正在使用 GitHub Actions 来构建我的项目,但我的 Dart 项目位于存储库的子目录中。操作脚本无法找到我的pubspec.yaml并获取依赖项。
如何指向我的 GitHub Action 以在我的存储库中的子目录中查找源代码?
. (root of my GitHub repository)
??? dart_project
??? pubspec.yaml <-- Git Hub action must point to this sub-dir
??? node_project
??? packages.json
Run Code Online (Sandbox Code Playgroud)
这是我得到的错误:
Could not find a file named "pubspec.yaml" in "/__w/<my_project_path>".
##[error]Process completed with exit code 66.
Run Code Online (Sandbox Code Playgroud)
这是dart.ymlGitHub 自动生成的文件。
name: Dart CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
container:
image: google/dart:latest
steps:
- uses: actions/checkout@v1
- name: Install dependencies
run: pub get
- name: …Run Code Online (Sandbox Code Playgroud) 我正在运行 javascript github 操作示例,当我有
在:[推]
但不是当我有
on:
schedule:
- cron: '*/5 * * * *'
Run Code Online (Sandbox Code Playgroud)
我希望 github 操作每 5 分钟运行一次,但它似乎根本没有运行。
这是我的其余代码供参考
.github/worflows/main.yml
on:
schedule:
- cron: '*/5 * * * *'
jobs:
hello_world_job:
runs-on: ubuntu-latest
name: A job to say hello
steps:
- name: Hello world action step
id: hello
uses: StephenVNelson/website/@3-experiment-with-actions
with:
who-to-greet: 'Mona the Octocat'
# Use the output from the `hello` step
- name: Get the output time
run: echo "The time was ${{ steps.hello.outputs.time }}"
Run Code Online (Sandbox Code Playgroud)
./action.yml …
github操作中的push和pull_request区别?
在每个拉取请求中,我们都在推送我们的代码,那么为什么我们需要推送,而拉取请求仅仅推送就足够了?
在 GitHub 中,我有一个名为 的拉取请求[WIP] Dev-123 Sample Pull Request。
我想在 GitHub Actions yaml 管道中获取此标题。
在GitHub Docs Context中,我似乎找不到需要引用的对象。
我有一个 GitHub 操作工作流文件 @ myrepo/.github/workflows/Build Webpage.yml 它包含以下内容:
name: Webpage Build
on:
push:
branches:
- webpage
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: setup node
uses: actions/setup-node@v2-beta
with:
node-version: '12'
- name: install deps and predeploy
run: |
npm ci
npm run predeploy
- name: Deploy
uses: JamesIves/github-pages-deploy-action@3.5.2
with:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
BRANCH: gh-pages
FOLDER: build
Run Code Online (Sandbox Code Playgroud)
当我推到网页分支什么也没有发生在动作片的一切我不能说,如果我有一个语法错误,或者如果事情是完全不正确设置,我在过去的这个回购了关于语法错误像every step must define a 'uses' or 'run' key 这对我来说,Github 确实识别了工作流程