-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (44 loc) · 1.35 KB
/
generate.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
name: Generate Combined Software List
on:
workflow_dispatch:
push:
branches:
- '*'
- '!main'
# paths:
# - 'tags/*.yml'
# - 'alias.yml'
# - 'overwrite.yml'
jobs:
validate-yaml:
runs-on: ubuntu-22.04
steps:
- name: Setup Repo
uses: actions/checkout@v3
- name: Set Git Credentials
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git fetch -v --unshallow
git pull -v --all
- name: Install dependencies
run: |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Validate YAML here;
run: echo TODO
- name: Generate Merged YAML
run: python3 .github/workflows/merge.py
- name: Check if changes
id: changes
run: |
git add --all
git status
git diff --cached --quiet && echo "There are no changes." || ( echo "There are changes" && echo "diff=true" >> $GITHUB_OUTPUT )
- name: Commit to main
if: steps.changes.outputs.diff == 'true'
run: |
echo {{ steps.changes.outputs.diff }}
git commit --allow-empty -m "Automated merge"
git checkout main
git merge -X 'theirs' -v ${GITHUB_REF##*/}
git push -v -f origin main