forked from redhat-developer/rhdh-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (81 loc) · 3.09 KB
/
Copy pathdetect-new-workspace.yml
File metadata and controls
97 lines (81 loc) · 3.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Detect and propose Renovate presets for new workspaces
on:
schedule:
- cron: "0 6 * * 1" # Every Monday at 06:00 UTC
workflow_dispatch:
permissions:
contents: write
pull-requests: write
concurrency:
group: new-workspace-presets
cancel-in-progress: false
jobs:
prepare:
name: Detect uncovered workspaces
runs-on: ubuntu-latest
outputs:
workspaces: ${{ steps.detect.outputs.workspaces }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@a5ad31d6a139d249332a2605b85202e8c0b78450 # v2.19.1
with:
egress-policy: audit
- name: Checkout main
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
ref: main
token: ${{ secrets.RHDH_BOT_TOKEN }}
fetch-depth: 1
- name: Set up Node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 24
- name: Install dependencies
run: yarn install --immutable
- name: Detect new workspaces
id: detect
run: echo "workspaces=$(node scripts/ci/detect-new-workspaces.js --list | jq -c .)" >> $GITHUB_OUTPUT
propose:
name: Propose preset for workspace
runs-on: ubuntu-latest
needs: prepare
if: needs.prepare.outputs.workspaces != '[]' && needs.prepare.outputs.workspaces != ''
strategy:
matrix:
workspace: ${{ fromJSON(needs.prepare.outputs.workspaces) }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@a5ad31d6a139d249332a2605b85202e8c0b78450 # v2.19.1
with:
egress-policy: audit
- name: Checkout main
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
ref: main
token: ${{ secrets.RHDH_BOT_TOKEN }}
fetch-depth: 1
- name: Set up Node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 24
- name: Install dependencies
run: yarn install --immutable
- name: Apply changes for workspace
id: apply
run: node scripts/ci/detect-new-workspaces.js --apply "${{ matrix.workspace }}"
- name: Create Pull Request
uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c # v6.1.0
with:
token: ${{ secrets.RHDH_BOT_TOKEN }}
base: main
branch: automation/add-renovate-presets-${{ matrix.workspace }}
commit-message: "chore: add Renovate presets for ${{ matrix.workspace }}"
title: "chore: add Renovate presets for ${{ matrix.workspace }}"
body: |
This PR adds Renovate presets for the new `${{ matrix.workspace }}` workspace.
Extends: base minor/patch/devdependency presets.
Created by [Detect New Workspace ${{ github.run_id }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
signoff: true
add-paths: |
.github/renovate-presets/workspace/*.json
.github/renovate.json