mirror of
https://github.com/kyverno/kyverno.git
synced 2024-12-14 11:57:48 +00:00
fix: condition jobs in gh actions (#5925)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
This commit is contained in:
parent
bb6005a7a3
commit
ae1d210319
2 changed files with 34 additions and 1 deletions
21
.github/actions/is-defined/action.yaml
vendored
Normal file
21
.github/actions/is-defined/action.yaml
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
name: Checks if an input is defined
|
||||
|
||||
description: Checks if an input is defined and outputs 'true' or 'false'.
|
||||
|
||||
inputs:
|
||||
value:
|
||||
description: value to test
|
||||
required: true
|
||||
|
||||
outputs:
|
||||
result:
|
||||
description: outputs 'true' or 'false' if input value is defined or not
|
||||
value: ${{ steps.check.outputs.result }}
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- shell: bash
|
||||
id: check
|
||||
run: |
|
||||
echo "result=${{ inputs.value != '' }}" >> $GITHUB_OUTPUT
|
14
.github/workflows/pr-update.yaml
vendored
14
.github/workflows/pr-update.yaml
vendored
|
@ -7,8 +7,20 @@ on:
|
|||
- 'release-*'
|
||||
|
||||
jobs:
|
||||
checksecret:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
result: ${{ steps.check.outputs.result }}
|
||||
steps:
|
||||
- name: Check secret
|
||||
id: check
|
||||
uses: ./.github/actions/is-defined
|
||||
with:
|
||||
value: ${{ secrets.PR_UPDATE_TOKEN }}
|
||||
|
||||
autoupdate:
|
||||
if: ${{ secrets.PR_UPDATE_TOKEN }}
|
||||
needs: [checksecret]
|
||||
if: needs.checksecret.outputs.result == 'true'
|
||||
permissions:
|
||||
pull-requests: write
|
||||
runs-on: ubuntu-latest
|
||||
|
|
Loading…
Reference in a new issue