Skip to content

Commit

Permalink
Merge pull request #2110 from camptocamp/c2cciutils-upgrade-6.0
Browse files Browse the repository at this point in the history
CI updates
  • Loading branch information
sbrunner authored Jan 18, 2024
2 parents b6291da + b2cfc64 commit 6411812
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 48 deletions.
23 changes: 0 additions & 23 deletions .github/workflows/delete-old-workflows-run.yaml

This file was deleted.

25 changes: 0 additions & 25 deletions .github/workflows/dependency-auto-review.yaml

This file was deleted.

87 changes: 87 additions & 0 deletions .github/workflows/pull-request-automation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Auto reviews, merge and close pull requests

on:
pull_request:
types:
- opened
- reopened

jobs:
auto-merge:
name: Auto reviews, merge and close pull requests
runs-on: ubuntu-22.04
timeout-minutes: 5

steps:
- uses: actions/github-script@v6
with:
script: |-
github.rest.pulls.createReview({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.pull_request.number,
event: 'APPROVE',
})
name: Auto reviews Renovate updates
if: github.event.pull_request.user.login == 'renovate[bot]'
- name: Auto review and merge dpkg updates
uses: actions/github-script@v7
if: github.event.pull_request.user.login == 'c2c-bot-gis-ci' && startsWith(github.head_ref, 'dpkg-update/')
with:
script: |-
github.rest.pulls.createReview({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.pull_request.number,
event: 'APPROVE',
});
github.graphql(`
mutation {
enablePullRequestAutoMerge(input: {
pullRequestId: "${context.payload.pull_request.node_id}",
mergeMethod: SQUASH,
}) {
pullRequest {
autoMergeRequest {
enabledAt
}
}
}
}
`)
- name: Auto review and merge snyk auto fix
uses: actions/github-script@v7
if: github.event.pull_request.user.login == 'c2c-bot-gis-ci' && startsWith(github.head_ref, 'snyk-fix/')
with:
script: |-
github.rest.pulls.createReview({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.pull_request.number,
event: 'APPROVE',
});
github.graphql(`
mutation {
enablePullRequestAutoMerge(input: {
pullRequestId: "${context.payload.pull_request.node_id}",
mergeMethod: SQUASH,
}) {
pullRequest {
autoMergeRequest {
enabledAt
}
}
}
}
`)
- name: Auto close pre-commit.ci autoupdate
uses: actions/github-script@v7
if: github.event.pull_request.user.login == 'pre-commit-ci'
with:
script: |-
github.rest.pulls.update({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.pull_request.number,
state: 'closed',
});

0 comments on commit 6411812

Please sign in to comment.