Skip to content

Commit

Permalink
refactor(ci): new new audit reports will create pull request
Browse files Browse the repository at this point in the history
  • Loading branch information
enisdenjo committed Oct 10, 2024
1 parent a1cc086 commit 07af63f
Showing 1 changed file with 10 additions and 25 deletions.
35 changes: 10 additions & 25 deletions .github/workflows/audits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@ on:
push:
branches:
- main
pull_request_target:
pull_request:
branches:
- main

jobs:
javascript:
name: JavaScript
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]')"
strategy:
matrix:
workspace:
Expand All @@ -27,9 +26,6 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.head_ref }}
- name: Set up node
uses: actions/setup-node@v3
with:
Expand Down Expand Up @@ -59,7 +55,6 @@ jobs:
docker:
name: Docker
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]')"
strategy:
matrix:
workspace:
Expand All @@ -74,9 +69,6 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.head_ref }}
- name: Set up docker buildx
uses: docker/setup-buildx-action@v2
- name: Set up node
Expand Down Expand Up @@ -116,7 +108,6 @@ jobs:
url:
name: URL
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]')"
strategy:
matrix:
workspace:
Expand All @@ -127,9 +118,6 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.head_ref }}
- name: Set up node
uses: actions/setup-node@v3
with:
Expand All @@ -155,28 +143,25 @@ jobs:
implementations/${{ matrix.workspace.name }}/report.json
report:
permissions:
contents: write
pull-requests: write
name: Report
runs-on: ubuntu-latest
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
needs: [javascript, docker, url]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.head_ref }}
- name: Download audit reports
uses: actions/download-artifact@v3
with:
name: audit-reports
- name: Render servers table
run: node scripts/render-servers-table.mjs
- name: Diff
run: git diff --minimal
- name: Commit
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
[ -z "$(git status --porcelain)" ] \
&& echo "::notice::Nothing new to report." \
|| (git add . && git commit -m "docs(implementations): audit report [skip ci]" && git push)
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
title: Audit Report
body: New audit report available.
commit-message: 'docs(implementations): audit report'

0 comments on commit 07af63f

Please sign in to comment.