-
Notifications
You must be signed in to change notification settings - Fork 8
71 lines (61 loc) · 2.37 KB
/
update-emil-git-tag.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
---
name: Update amp-embedded-infra-lib Git Tag
on:
schedule:
- cron: "0 6 * * *"
workflow_dispatch:
permissions:
contents: read
jobs:
update_git_tag:
name: Update git tag and create PR when changed
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- uses: seanmiddleditch/gha-setup-ninja@96bed6edff20d1dd61ecff9b75cc519d516e6401 # v5
- name: Pull latest hash
id: pull_head
run: |
cmake --preset host
cd ./build/host/_deps/emil-src
current_hash="$(git rev-parse HEAD)"
git switch main
git pull
latest_hash="$(git rev-parse HEAD)"
git_log="$(git log --oneline --format="%s" "$current_hash".."$latest_hash")"
echo "current_hash=$current_hash"
echo "latest_hash =$latest_hash"
echo "$git_log"
{
echo "current_hash=$current_hash"
echo "latest_hash=$latest_hash"
echo "git_log<<EOF"
echo "$git_log"
echo "EOF"
} >> "$GITHUB_OUTPUT"
- name: Update CMakeLists.txt
if: ${{ steps.pull_head.outputs.current_hash != steps.pull_head.outputs.latest_hash }}
run: |
sed -i 's/${{ steps.pull_head.outputs.current_hash }}/${{ steps.pull_head.outputs.latest_hash }}/g' CMakeLists.txt
rm -rf ninja-build
- uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1.11.0
id: token
with:
app-id: ${{ vars.FOREST_RELEASER_APP_ID }}
private-key: ${{ secrets.FOREST_RELEASER_APP_PRIVATE_KEY }}
- uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7.0.5
if: ${{ steps.pull_head.outputs.current_hash != steps.pull_head.outputs.latest_hash }}
with:
token: ${{ steps.token.outputs.token }}
commit-message: "chore: update amp-embedded-infra-lib hash to ${{ steps.pull_head.outputs.latest_hash }}"
title: "chore: update amp-embedded-infra-lib hash to ${{ steps.pull_head.outputs.latest_hash }}"
body: |
commits on amp-embedded-infra-lib:
```
${{ steps.pull_head.outputs.git_log }}
```