<p><a href="https://github.com/potiuk/get-workflow-origin/actions">
<img alt="get-workflow-origin status"
src="https://github.com/potiuk/get-workflow-origin/workflows/Test%20the%20build/badge.svg"></a>
# Get Workflow Origin action
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
- [Context and motivation](#context-and-motivation)
- [Inputs and outputs](#inputs-and-outputs)
- [Inputs](#inputs)
- [Outputs](#outputs)
- [Examples](#examples)
- [Workflow Run event](#workflow-run-event)
- [Workflow Run event](#workflow-run-event-1)
- [Development environment](#development-environment)
- [License](#license)
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
# Context and motivation
Get Workflow Origin is an action that provides information about the pull requests that triggered the
workflow for the `pull_request` and `pull_request_review` events or for the `workflow_run` event
that is triggered by one of those events.
Often in those events you want to get more information about the source run than the
one provided directly via GitHub context.
For example, you would like to know what is the merge commit generated by pull request in case
the workflow is triggered by a pull request, or labels associated with the Pull Request.
This action provides outputs that give that information. You should add this action as first
one in your workflow and then you will be able to use those outputs using 'needs' dependency.
The `sourceRunId` input should not be specified in case of the `pull_request` event, but it should
be set to `${{ github.event.workflow_run.id }}` in case of the `workflow_run` event.
# Inputs and outputs
## Inputs
| Input | Required | Default | Comment |
|-------------------------|----------|--------------|-----------------------------------------------------------------------------------------------------|
| `token` | yes | | The github token passed from `${{ secrets.GITHUB_TOKEN }}` |
| `sourceRunId` | no | | In case of 'workflow_run' event it should be set to `${{ github.event.workflow_run.id }}` |
## Outputs
| Output | No `sourceRunId` specified | The `sourceRunId` set to `${{ github.event.workflow_run.id }}` |
|----------------------|-------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------|
| `sourceHeadRepo` | Current repository. Format: `owner/repo` | Repository of the run that triggered this `workflow_run`. Format: `owner/repo` |
| `sourceHeadBranch` | Current branch. | Branch of the run that triggered this `workflow_run`. Might be forked repo, if it is a pull_request. |
| `sourceHeadSha` | Current commit SHA: `{{ github.sha }}` | Commit sha of the run that triggered this `workflow_run`. |
| `mergeCommitSha` | Merge commit SHA if PR-triggered event. | Merge commit SHA if PR-triggered event. |
| `targetCommitSha` | Target commit SHA (merge if present, otherwise source). | Target commit SHA (merge if present, otherwise source). |
| `pullRequestNumber` | Number of the associated Pull Request (if PR triggered) | Number of the associated Pull Request (if PR triggered) |
| `pullRequestLabels` | Stringified JSON array of Labels of the associated Pull Request (if PR triggered) | Stringified JSON array of Labels of the associated Pull Request (if PR triggered) |
| `targetBranch` | Target branch of the pull request or target branch for push | Target branch of the pull request or target branch for push |
| `sourceEvent` | Current event: ``${{ github.event }}`` | Event of the run that triggered this `workflow_run` |
# Examples
### Workflow Run event
```yaml
name: Get information
on:
pull_request:
branches: ['main']
jobs:
get-info:
name: "Get information about the source run"
runs-on: ubuntu-latest
outputs:
sourceHeadRepo: ${{ steps.workflow-run-info.outputs.sourceHeadRepo }}
sourceHeadBranch: ${{ steps.workflow-run-info.outputs.sourceHeadBranch }}
sourceHeadSha: ${{ steps.workflow-run-info.outputs.sourceHeadSha }}
mergeCommitSha: ${{ steps.workflow-run-info.outputs.mergeCommitSha }}
targetCommitSha: ${{ steps.workflow-run-info.outputs.targetCommitSha }}
pullRequestNumber: ${{ steps.workflow-run-info.outputs.pullRequestNumber }}
pullRequestLabels: ${{ steps.workflow-run-info.outputs.pullRequestLabels }}
targetBranch: ${{ steps.source-run-info.outputs.targetBranch }}
sourceEvent: ${{ steps.workflow-run-info.outputs.sourceEvent }}
steps:
- name: "Get information about the current run"
uses: potiuk/get-workflow-origin@v1_1
id: workflow-run-info
with:
token: ${{ secrets.GITHUB_TOKEN }}
```
### Workflow Run event
```yaml
name: Build
on:
workflow_run:
workflows: ['CI']
types: ['requested']
jobs:
get-info:
name: "Get information about the source run"
runs-on: ubuntu-latest
outputs:
sourceHeadRepo: ${{ steps.source-run-info.outputs.sourceHeadRepo }}
sourceHeadBranch: ${{ steps.source-run-info.outputs.sourceHeadBranch }}
sourceHeadSha: ${{ steps.source-run-info.outputs.sourceHeadSha }}
mergeCommitSha: ${{ steps.source-run-info.outputs.mergeCommitSha }}
targetCommitSha: ${{ steps.source-run-info.outputs.targetCommitSha }}
pullRequestNumber: ${{ steps.source-run-info.outputs.pullRequestNumber }}
pullRequestLabels: ${{ steps.source-run-info.outputs.pullRequestLabels }}
targetBranch: ${{ steps.source-run-info.outputs.targetBranch }}
sourceEvent: ${{ steps.source-run-info.outputs.sourceEvent }}
steps:
- name: "Get information about the origin 'CI' run"
uses: potiuk/get-workflow-origin@v1_1
id: source-run-info
with:
token: ${{ secrets.GITHUB_TOKEN }}
sourceRunId: ${{ github.event.workflow_run.id }}```
```
## Development environment
It is highly recommended tu use [pre commit](https://pre-commit.com). The pre-commits
installed via pre-commit tool handle automatically linting (including automated fixes) as well
as building and packaging Javascript index.js from the main.ts Typescript code, so you do not have
to run it yourself.
## License
[MIT License](LICENSE) covers the scripts and documentation in this project.
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
机器学习(Machine Learning, ML)是一种应用人工智能(AI)领域的科学技术,它使得计算机系统能够从数据中自动学习和改进,而无需显式编程。在机器学习的过程中,算法会通过识别和挖掘数据中的模式来构建一个模型,这个模型可以用于做出预测、分类、聚类、回归以及其他复杂的数据驱动决策。 机器学习的主要类型包括监督学习、无监督学习和半监督学习。在监督学习中,算法根据已知标签的数据集进行训练,以便对未知数据进行预测,例如分类任务(判断邮件是否为垃圾邮件)或回归任务(预测房价)。无监督学习则是在没有标签的情况下,仅凭数据本身的特征发现其中隐藏的结构或模式,如聚类分析(将用户分组到不同的客户细分群体中)。半监督学习介于两者之间,它部分数据有标签,部分数据无标签。 机器学习算法涵盖众多方法,包括但不限于逻辑回归、决策树、随机森林、支持向量机、K近邻算法、神经网络以及深度学习技术等。随着计算能力的增强和大数据时代的到来,机器学习已经在诸多领域展现出强大的功能,如图像识别、语音识别、自然语言处理、推荐系统、金融风控、医疗诊断等。 此外,机器学习的发展与统计学习、逼近论、凸优化、概率论等诸多数学和计算机科学领域紧密相关,且不断地推动着新算法和理论框架的创新与发展。同时,现代机器学习尤其是深度学习模型的内部工作机制有时难以完全解释,因此常被称为“黑箱”决策过程,这也是当前研究中的一个重要挑战。
资源推荐
资源详情
资源评论
收起资源包目录
机器学习基本算法学习.zip (93个子文件)
content
support_vector_machine
__init__.py 0B
smo.py 8KB
testSetRBF2.txt 3KB
testSetRBF.txt 3KB
smo_simple.py 7KB
README.md 317B
hand_writing_class_test.py 3KB
testSet.txt 2KB
logistic_regression
__init__.py 0B
horseColicTraining.txt 59KB
horse_colic_test.py 1KB
logistic_reg.py 4KB
README.md 118B
horseColicTest.txt 4KB
testSet.txt 2KB
.github
ISSUE_TEMPLATE
feature-request.yml 3KB
umbrella.yml 3KB
bug-report.yml 5KB
workflows
codeql.yaml 2KB
approve-label-trigger.yml 1KB
approve-label.yml 2KB
code-analysys.yml 1KB
backend.yml 31KB
publish-docker.yaml 2KB
schedule_backend.yml 4KB
documents.yml 2KB
license.yml 2KB
stale.yml 3KB
build_main.yml 967B
actions
get-workflow-origin
__tests__
main.test.ts 125B
.github
workflows
test.yml 1KB
jest.config.js 236B
src
main.ts 5KB
LICENSE 1KB
action.yml 561B
yamllint-config.yml 842B
.pre-commit-config.yaml 1KB
.prettierignore 25B
dist
index.js 603KB
package.json 1KB
package-lock.json 424KB
.eslintrc.json 3KB
.prettierrc.json 226B
.gitignore 1KB
.eslintignore 25B
tsconfig.json 1KB
README.md 8KB
label-when-approved-action
__tests__
main.test.ts 125B
.github
workflows
test.yml 1KB
jest.config.js 236B
src
main.ts 8KB
LICENSE 1KB
action.yml 995B
yamllint-config.yml 842B
.pre-commit-config.yaml 1KB
.prettierignore 25B
dist
index.js 608KB
package.json 1KB
package-lock.json 480KB
.eslintrc.json 3KB
.prettierrc.json 226B
.gitignore 1KB
.eslintignore 25B
tsconfig.json 1KB
transpilation_state
main.ts.md5sum 48B
README.md 6KB
scripts
transpile_if_needed.sh 566B
PULL_REQUEST_TEMPLATE.md 2KB
common
__init__.py 0B
util.py 5KB
KNN
__init__.py 0B
test_for_number.py 1KB
datingTestSet.txt 34KB
kNN.py 3KB
test.py 805B
README.md 343B
datingTestSet2.txt 25KB
ID3
__init__.py 0B
ID3.py 4KB
lenses.txt 771B
README.md 138B
.gitignore 29B
naive_bayes
__init__.py 0B
test_for_rss.py 3KB
test.py 2KB
bayes.py 5KB
README.md 370B
Adaboost
__init__.py 0B
adaboost.py 6KB
horseColicTraining2.txt 59KB
README.md 297B
horseColicTest2.txt 13KB
README.md 195B
共 93 条
- 1
资源评论
生瓜蛋子
- 粉丝: 3612
- 资源: 2901
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功