-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (49 loc) · 1.7 KB
/
check_version.yaml
File metadata and controls
52 lines (49 loc) · 1.7 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
name: Check Version
on:
schedule:
# Schedule every 12 hours
- cron: '0 */12 * * *'
workflow_dispatch:
jobs:
check:
runs-on: ubuntu-latest
outputs:
update: ${{ steps.jobOutput.outputs.update }}
steps:
- uses: actions/checkout@v2
- name: Get current version
run: |
echo "currentVersion=$(grep -m1 'version:' pubspec.yaml | awk '{print $2}')" >> $GITHUB_ENV
- name: print current version
run: |
echo "Current Version: ${{ env.currentVersion }}"
- name: Clone codelessly_starter_brick
run: |
rm -rf codelessly_starter_brick
git clone https://github.com/Codelessly/codelessly_starter_brick.git --single-branch
- name: Get Latest Version
run: |
echo "starterVersion=$(grep -m1 'version:' codelessly_starter_brick/__brick__/pubspec.yaml | awk '{print $2}')" >> $GITHUB_ENV
- name: print version
run: |
echo "Starter Version: ${{ env.starterVersion }}"
- name: Compare versions
run: |
if [ "${{ env.currentVersion }}" != "${{ env.starterVersion }}" ]; then
echo "Versions are different"
echo "update=true" >> $GITHUB_ENV
else
echo "Versions are the same"
echo "update=false" >> $GITHUB_ENV
fi
- name: print update
run: |
echo "Should Update: ${{ env.update }}"
- name: Set Job Output
id: jobOutput
run: echo "update=${{ env.update }}" >> "$GITHUB_OUTPUT"
update:
needs: check
uses: codelessly/codelessly-test-app/.github/workflows/update_repo.yaml@main
if: ${{ needs.check.outputs.update == 'true' }}
secrets: inherit