Skip to content

Commit

Permalink
Merge pull request #113 from XenitAB/status-action
Browse files Browse the repository at this point in the history
GitHub Action support for status action
  • Loading branch information
Edvin N authored Oct 25, 2021
2 parents e785866 + 1d651a6 commit c7cb349
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,28 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
```

In order to block automatic promotion, you can add a status workflow:

```yaml
on:
pull_request:
branches:
- main
jobs:
prev-env-status:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
# gitops-promotion currently needs access to history
fetch-depth: 0
- uses: xenitab/gitops-promotion@v0.0.8
with:
action: status
token: ${{ secrets.GITHUB_TOKEN }}
```

## Building

You will need pkg-config and libgit2, please install it from your package manager.
Expand Down
6 changes: 6 additions & 0 deletions action-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ case $ACTION in
-sourcedir "$GITHUB_WORKSPACE" \
-token "$TOKEN"
;;
status)
/usr/local/bin/gitops-promotion status \
-provider github \
-sourcedir "$GITHUB_WORKSPACE" \
-token "$TOKEN"
;;
*)
echo "Unkown action $ACTION"
exit 1
Expand Down
4 changes: 3 additions & 1 deletion action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ description: |
A tool to do automatic promotion with a GitOps workflow.
inputs:
action:
description: Action to perform; one of "new" or "promote".
description: >
Action to perform; one of "new", "promote" or "status". See
https://github.com/XenitAB/gitops-promotion/README.md for details.
required: true
token:
description: Access token (PAT) to git provider. You probably want secrets.GITHUB_TOKEN
Expand Down

0 comments on commit c7cb349

Please sign in to comment.