-
Notifications
You must be signed in to change notification settings - Fork 209
73 lines (61 loc) · 2.63 KB
/
reprocess_all_images.yml
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
name: Re-Process All Images
on:
workflow_dispatch:
inputs:
remove_not_in_manifest:
description: 'Remove images not found in manifest (if false, will be moved to separate dir instead).'
required: true
default: false
type: boolean
# skip_download_third_parties:
# description: 'Skip the step that downloads firmware with 3rd party URLs in manifest.'
# required: true
# default: true
# type: boolean
permissions:
contents: write
pull-requests: write
jobs:
reprocess-all-images:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org/
cache: pnpm
- name: Install dependencies
run: pnpm i --frozen-lockfile
- name: Build
run: pnpm run build
- name: Create and checkout new branch
id: create_branch
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
branch_name="reprocess-$(date +'%Y-%m-%d-%H-%M-%S')"
echo "branch_name=$branch_name" >> $GITHUB_OUTPUT
git checkout -b $branch_name
- name: Reprocess
uses: actions/github-script@v7
env:
NODE_EXTRA_CA_CERTS: cacerts.pem
with:
script: |
const {reProcessAllImages} = await import("${{ github.workspace }}/dist/ghw_reprocess_all_images.js")
await reProcessAllImages(github, core, context, ${{ fromJSON(inputs.remove_not_in_manifest) }}, true)
- name: Commit changes in new branch
run: |
git add .
git commit -m "Re-Processed all images" || echo 'Nothing to commit'
git push -u origin HEAD
- name: Create pull request
uses: actions/github-script@v7
with:
script: |
const {createPRToDefault} = await import("${{ github.workspace }}/dist/ghw_create_pr_to_default.js")
await createPRToDefault(github, core, context, "${{steps.create_branch.outputs.branch_name}}", "Re-Processed all images")