Skip to content

Commit

Permalink
GH Workflows: Refactor label workflows
Browse files Browse the repository at this point in the history
Jenkins builds are now triggered on adding label event.
There are 2 possibilites to trigger Jenkins build on PRs from untrusted
authors:
1. Ci-Requested label:
  * one-time permission for given commit
  * label is automatically removed when PR is modified
  * reviewer has to add Ci-Requested label after PR is modified to
    trigger Jenkins build
2. Ci-trusted-author label:
  * permission for given PR
  * label is removed and added again after PR is modified - this sends
    new webhook
  * Jenkins build is triggered automaically after PR is modified

Signed-off-by: Jan Gałda <[email protected]>
  • Loading branch information
jangalda-nsc authored and carlescufi committed Oct 10, 2023
1 parent c9b89a1 commit a40c8ce
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 17 deletions.
17 changes: 0 additions & 17 deletions .github/workflows/check-ci-requested.yml

This file was deleted.

24 changes: 24 additions & 0 deletions .github/workflows/reapply-ci-trusted-author.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Reapply CI-trusted-author label

on:
pull_request_target:
types: [opened, reopened, synchronize]

jobs:
remove_label:
if: ${{ contains(github.event.*.labels.*.name, 'CI-trusted-author') }}
runs-on: ubuntu-latest
name: Remove label
steps:
- name: Remove CI-trusted-author label
uses: buildsville/[email protected]
with:
token: '${{ secrets.GITHUB_TOKEN }}'
labels: CI-trusted-author
type: remove
- name: Add CI-trusted-author label
uses: buildsville/[email protected]
with:
token: '${{ secrets.GITHUB_TOKEN }}'
labels: CI-trusted-author
type: add

0 comments on commit a40c8ce

Please sign in to comment.