Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# See the OWNERS docs at https://go.k8s.io/owners
approvers:
- belitre
- givanov
- alexouzounis
reviewers:
- belitre
- givanov
- alexouzounis
aliases:
ouzi-team:
- belitre
- givanov
- alexouzounis
59 changes: 27 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,17 @@
A simple Github Action that allows us to update the status of a given commit.

GitHub does not update the status of a commit when running workflow and therefore tools that rely on the context/status of a given commit are not compatible with it.
An example is [Prow](https://github.com/kubernetes/test-infra/tree/master/prow) which uses the Github Status API to read the status of a given commit.

## Integration with Prow
## Input Parameters

If using [Prow](https://github.com/kubernetes/test-infra/tree/master/prow) you can now add GitHub Workflows as required checks.

### Example with Branch Protection and Tide
branch-protection:
```
branch-protection:
orgs:
{MY_ORG}:
repos:
{MY_REPO}:
branches:
master:
protect: true # enable protection
enforce_admins: true # rules apply to admins
required_status_checks:
contexts:
- "GithubActions - {WORKFLOW_NAME}"
restrictions: # restrict who can push to the repo
users:
- ouzibot
```
tide:
```
tide:
context_options:
from-branch-protection: true
```
* context: The context for the status
* optional
* default: GithubActions - ${GITHUB_WORKFLOW}
* state: Commit state. Possible values are 'pending', 'success', 'error' or 'failure'
* optional
* default: pending
* token: The Github token
* required

## Example action

Expand All @@ -49,7 +29,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: ouzi-dev/github-action-commit-status-updater@master
- uses: ouzi-dev/commit-status-updater@v0.1.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Test
Expand All @@ -58,15 +38,30 @@ jobs:
sleep 2m
echo pass
- if: success()
- uses: ouzi-dev/github-action-commit-status-updater@master
- uses: ouzi-dev/commit-status-updater@v0.1.0
with:
state: success
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- if: failure()
- uses: ouzi-dev/github-action-commit-status-updater@master
- uses: ouzi-dev/commit-status-updater@v0.1.0
with:
state: failure
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```


## Integration with Prow

An example is [Prow](https://github.com/kubernetes/test-infra/tree/master/prow) which uses the Github Status API to read the status of a given commit.
Using this actions you can tell tide to not skip optional contexts and effectively wait for a GitHub Workflow to pass before merging.

### Example with Tide

```
tide:
context_options:
# Treat unknown contexts as required
skip-unknown-contexts: false
```
5 changes: 4 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: 'commit-status-updater'
description: 'Updates the current commit status'

author: 'Ouzi, ltd. Ouzi Team <[email protected]>'
branding:
icon: 'check-circle'
color: 'purple'
inputs:
context:
description: 'The context for the status. Default is GithubActions - ${GITHUB_WORKFLOW}'
Expand Down