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

Abiltiy to run tests in Dependabot PRs and auto approve/merge #4265

Merged
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
36 changes: 4 additions & 32 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ updates:
labels:
- "dependabot"
- "javascript"
- "type::security"

## Go mod

Expand All @@ -19,18 +20,18 @@ updates:
schedule:
interval: "daily"
labels:
- "@actions/safe-to-test"
- "dependabot"
- "go"
- "type::security"

- package-ecosystem: "gomod"
directory: "/kurl_proxy"
schedule:
interval: "daily"
labels:
- "@actions/safe-to-test"
- "dependabot"
- "go"
- "type::security"

## GitHub Actions

Expand All @@ -39,35 +40,6 @@ updates:
schedule:
interval: "weekly"
labels:
- "@actions/safe-to-test"
- "dependabot"
- "github-actions"

## Dockerfiles

- package-ecosystem: "docker"
directory: "/deploy"
schedule:
interval: "weekly"
labels:
- "@actions/safe-to-test"
- "dependabot"
- "docker"

- package-ecosystem: "docker"
directory: "/kurl_proxy/deploy"
schedule:
interval: "weekly"
labels:
- "@actions/safe-to-test"
- "dependabot"
- "docker"

- package-ecosystem: "docker"
directory: "/migrations/deploy"
schedule:
interval: "weekly"
labels:
- "@actions/safe-to-test"
- "dependabot"
- "docker"
- "type::security"
31 changes: 17 additions & 14 deletions .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ jobs:
can-run-ci:
runs-on: ubuntu-20.04
# if the event is pull_request and:
# - it is not a fork OR it is from the dependabot
# - Then must have the label '@actions/safe-to-test'
# - it is not a fork OR
# - it has the label '@actions/safe-to-test'
#
# The 'pull_request_target' workflow trigger may lead to malicious PR authors being able to obtain repository write permissions or stealing repository secrets.
# Please read https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
Expand Down Expand Up @@ -51,18 +51,6 @@ jobs:
uses: ./.github/actions/version-tag


test-okteto-env:
runs-on: ubuntu-latest
needs: [ can-run-ci ]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Test Okteto development environment
uses: replicatedhq/action-okteto-test@main
with:
token: ${{ secrets.OKTETO_TOKEN }}
branch: ${{ github.head_ref }}

deps-web:
runs-on: ubuntu-20.04
needs: [ can-run-ci ]
Expand Down Expand Up @@ -3960,3 +3948,18 @@ jobs:
- name: succeed if validate-pr-tests job succeeded
if: needs.validate-pr-tests.result == 'success'
run: echo "Validation succeeded"

dependabot:
runs-on: ubuntu-20.04
needs: [ validate-success ]
if: github.actor == 'dependabot[bot]'
permissions:
contents: write
pull-requests: write
steps:
- name: Approve & Merge PR
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr review --approve ${{ github.event.pull_request.html_url }} --comment "LGTM :thumbsup:"
gh pr merge --auto --squash ${{ github.event.pull_request.html_url }}
Loading