Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding ok-to-test functionality #3960

Merged
merged 4 commits into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
34 changes: 34 additions & 0 deletions .github/trigger-on-label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Trigger on Label

on:
pull_request:
types: [labeled]

jobs:
trigger-workflows:
if: github.event.label.name == 'ok-to-test'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install yq
run: sudo snap install yq

- name: Check if labeler is authorized
id: check-authorization
run: |
LABELER=$(jq --raw-output .sender.login "$GITHUB_EVENT_PATH")
APPROVERS=$(yq e '.approvers[]' OWNERS)
if echo "$APPROVERS" | grep -Fxq "$LABELER"; then
echo "::set-output name=authorized::true"
else
echo "::set-output name=authorized::false"
fi

- name: Dispatch event
if: steps.check-authorization.outputs.authorized == 'true'
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
event-type: ok-to-test
4 changes: 3 additions & 1 deletion .github/workflows/circleci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: CircleCI Trigger Action
on:
pull_request:
types: [ opened, synchronize, reopened, ready_for_review ]
types: [opened, synchronize, reopened, ready_for_review]
push:
branches:
- main
Expand All @@ -11,6 +11,8 @@ on:
workflows: ["Dependabot"]
types:
- completed
repository_dispatch:
types: [ok-to-test]

permissions:
contents: write
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/cspell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
branches: [main]
pull_request:
branches: [main]
repository_dispatch:
types: [ok-to-test]

jobs:
codespell:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:
- main
paths-ignore:
- "**.md"
repository_dispatch:
types: [ok-to-test]

jobs:
trigger-circleci:
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
name: Dependabot
on: pull_request
on:
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled, ready_for_review]
branches:
- dependabot/**
repository_dispatch:
types: [ok-to-test]

permissions:
contents: write
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
name: Docs

on: [push]
on:
push:
branches:
- main
pull_request:
branches:
- main
repository_dispatch:
types: [ok-to-test]

jobs:
spelling:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
pull_request:
push:
branches: [main]
repository_dispatch:
types: [ok-to-test]

jobs:
lint:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/trigger-ga-vmi-pipeline-on-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v2


- name: Trigger VMI Build
env:
REPO: ${{ github.repository }}
run: |
curl -X POST \
-H "Authorization: token ${{ secrets.BACALHAU_VMI_DEPLOYMENT_SECRET }}" \
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/trigger-on-comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Trigger on Comment

on:
issue_comment:
types: [created]

jobs:
trigger-workflows:
if: github.event.issue.pull_request && contains(github.event.comment.body, '/oktotest')
runs-on: ubuntu-latest
steps:
- name: Check if commenter is authorized
id: check-authorization
run: |
COMMENTER=$(jq --raw-output .comment.user.login "$GITHUB_EVENT_PATH")
APPROVERS=$(yq e '.approvers[]' OWNERS)
if echo "$APPROVERS" | grep -Fxq "$COMMENTER"; then
echo "::set-output name=authorized::true"
else
echo "::set-output name=authorized::false"
fi
- name: Dispatch event
if: steps.check-authorization.outputs.authorized == 'true'
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
event-type: ok-to-test
8 changes: 8 additions & 0 deletions OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
approvers:
- aronchick
- wdbaruni
- js-ts
- frrist
- MichaelHoepler
aronchick marked this conversation as resolved.
Show resolved Hide resolved
reviewers:
- yarikoptic
Loading