commit | c657bb36aef4a7402bbe9b2e09a820320f8ff447 | [log] [tgz] |
---|---|---|
author | Jarek Potiuk <jarek@potiuk.com> | Sat Oct 10 11:57:48 2020 +0200 |
committer | Jarek Potiuk <jarek@potiuk.com> | Sat Oct 10 12:36:54 2020 +0200 |
tree | f8ce3093a8b97cb706ea0ccce1500936a1b7488c |
Initial version
Table of Contents generated with DocToc
Get Workflow Origin is an action that provides missing information for workflow_run
events Often in the workflow_run
event 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 was triggered by a pull request.
This action provides outputs that give the missing information. You should add this action as first one in the “workflow_run” event and then you will be able to use those outputs.
Input | Required | Default | Comment |
---|---|---|---|
token | yes | The github token passed from ${{ secrets.GITHUB_TOKEN }} | |
sourceRunId | yes | It should be set to the id of the workflow triggering the run ${{ github.event.workflow_run.id }} |
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) |
sourceEvent | Current event: ${{ github.event }} | Event of the run that triggered this workflow_run |
It is highly recommended tu use pre commit. 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.
MIT License covers the scripts and documentation in this project.