Skip to content

Commit

Permalink
Merge pull request #1756 from camptocamp/c2cciutils-upgrade
Browse files Browse the repository at this point in the history
CI updates
  • Loading branch information
sbrunner authored Apr 8, 2024
2 parents 8d98605 + 31235dd commit b503e5e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 93 deletions.
51 changes: 0 additions & 51 deletions .github/workflows/changelog.yaml

This file was deleted.

10 changes: 7 additions & 3 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,13 @@ jobs:
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
restore-keys: "pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}\npre-commit-"
- run: pre-commit run --all-files
env:
SKIP: poetry-lock
- run: git diff && false
- run: git diff --exit-code --patch > /tmp/pre-commit.patch || true
if: failure()
- uses: actions/upload-artifact@v4
with:
name: Apply pre-commit fix.patch
path: /tmp/pre-commit.patch
retention-days: 1
if: failure()
- name: Print environment information
run: c2cciutils-env
Expand Down
56 changes: 17 additions & 39 deletions .github/workflows/pull-request-automation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,23 @@ jobs:
with:
script: |-
console.log(context);
- name: Auto reviews GHCI updates
uses: actions/github-script@v7
with:
script: |-
github.rest.pulls.createReview({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.pull_request.number,
event: 'APPROVE',
})
if: |-
startsWith(github.head_ref, 'ghci/audit/')
&& (github.event.pull_request.user.login == 'ghci-test[bot]'
|| github.event.pull_request.user.login == 'ghci-int[bot]'
|| github.event.pull_request.user.login == 'ghci[bot]')
&& (github.event.action == 'opened'
|| github.event.action == 'reopened')
- name: Auto reviews Renovate updates
uses: actions/github-script@v7
with:
Expand Down Expand Up @@ -98,42 +115,3 @@ jobs:
&& startsWith(github.head_ref, 'snyk-fix/')
&& (github.event.action == 'opened'
|| github.event.action == 'reopened')
- name: Restart audit workflow
uses: actions/github-script@v7
with:
script: |-
let runs = await github.rest.actions.listWorkflowRuns({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'audit.yaml',
per_page: 1,
});
runs = runs.data.workflow_runs;
if (runs.length == 1 && runs[0].status != 'success') {
console.log(`Rerun workflow ${runs[0].id} ${runs[0].status}`);
github.rest.actions.reRunWorkflowFailedJobs({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: runs[0].id,
});
}
if: |-
github.event.pull_request.user.login == 'c2c-bot-gis-ci-2'
&& (startsWith(github.head_ref, 'snyk-fix/')
|| startsWith(github.head_ref, 'dpkg-update/'))
&& github.event.action == 'closed'
&& github.event.pull_request.merged == true
- name: Auto close pre-commit.ci autoupdate
uses: actions/github-script@v7
with:
script: |-
github.rest.pulls.update({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.pull_request.number,
state: 'closed',
});
if: |-
github.event.pull_request.user.login == 'pre-commit-ci'
&& (github.event.action == 'opened'
|| github.event.action == 'reopened')

0 comments on commit b503e5e

Please sign in to comment.