forked from Installomator/Installomator
-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (75 loc) · 2.9 KB
/
Copy pathmanual-assemble.yml
File metadata and controls
87 lines (75 loc) · 2.9 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
name: Assemble and open PR
on:
workflow_dispatch:
inputs:
create_draft:
description: "Create as draft PR"
required: false
default: "true"
type: choice
options:
- "true"
- "false"
permissions:
contents: write
pull-requests: write
jobs:
assemble:
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
persist-credentials: false
- name: Run assemble.sh
run: |
./assemble.sh --script
echo "Assembly completed successfully"
- name: Check for changes
id: changes
run: |
tmp_current=$(mktemp)
tmp_head=$(mktemp)
trap 'rm -f "$tmp_current" "$tmp_head"' EXIT
sed '/^VERSIONDATE=/d' Installomator.sh > "$tmp_current"
git show HEAD:Installomator.sh | sed '/^VERSIONDATE=/d' > "$tmp_head"
if cmp -s "$tmp_current" "$tmp_head" && git diff --quiet -- Labels.txt; then
echo "changed=false" >> $GITHUB_OUTPUT
echo "No substantive changes detected"
else
echo "changed=true" >> $GITHUB_OUTPUT
echo "Substantive changes detected in Installomator.sh and/or Labels.txt"
git diff --stat Installomator.sh Labels.txt
fi
- name: Create Pull Request
if: steps.changes.outputs.changed == 'true'
uses: peter-evans/create-pull-request@v8
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "chore: regenerate Installomator.sh and Labels.txt from latest
labels"
title: "🤖 Regenerate Installomator.sh and Labels.txt"
body: |
Automated rebuild of Installomator.sh and Labels.txt from the latest label fragments.
**Changes:**
- Assembled from all labels in `fragments/labels/`
- Updated `Labels.txt` with current available labels
Generated by [manual-assemble workflow](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})
branch: auto/assemble-${{ github.run_id }}
delete-branch: false
draft: ${{ inputs.create_draft }}
labels: "labelomator"
author: "github-actions[bot] <github-actions[bot]@users.noreply.github.com>"
committer: "github-actions[bot] <github-actions[bot]@users.noreply.github.com>"
- name: Summary
if: always()
run: |
echo "## Assembly Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
if [ "${{ steps.changes.outputs.changed }}" = "true" ]; then
echo "✅ Changes detected and PR created/updated" >> $GITHUB_STEP_SUMMARY
else
echo "ℹ️ No changes detected - no PR created" >> $GITHUB_STEP_SUMMARY
fi