-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (49 loc) · 1.71 KB
/
infraFilesCongruencyCheck.yaml
File metadata and controls
57 lines (49 loc) · 1.71 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
name: infraFilesCongruencyCheck
on:
schedule:
- cron: '0 0,12 * * *'
push:
branches:
- main
jobs:
congruency-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: clientRepository
- uses: actions/checkout@v4
with:
repository: ajakhotia/infraCommons
path: templateRepository
ref: main
- name: "Run congruency check"
run: python3 templateRepository/ci/congruency_test.py -t templateRepository -c clientRepository --apply-diffs
- name: "Check for changes"
id: check_for_changes
run: |
cd clientRepository
if [[ -n "$(git status --porcelain)" ]]; then
echo "has_changes=true" >> $GITHUB_OUTPUT
else
echo "has_changes=false" >> $GITHUB_OUTPUT
fi
- name: "Create branch and pull request"
if: steps.check_for_changes.outputs.has_changes == 'true'
run: |
gh auth login --with-token <<< "${{ secrets.GITHUB_TOKEN }}"
cd clientRepository
branch_name="automated-update-$(date +%Y%m%d-%H%M%S)"
git checkout -b $branch_name
# Commit and push changes
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
git add .
git commit -m "Automated changes"
git push origin $branch_name
gh pr create \
--base main \
--head $branch_name \
--title "Automated Update" \
--body "This PR was automatically created by infraFilesCongruencyCheck GitHub Action to ensure that
core infra files remain synchronized with ajakhotia/infraCommons" \