Skip to content

Update amp-embedded-infra-lib Git Tag #472

Update amp-embedded-infra-lib Git Tag

Update amp-embedded-infra-lib Git Tag #472

---
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@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- uses: seanmiddleditch/gha-setup-ninja@3b1f8f94a2f8254bd26914c4ab9474d4f0015f67 # v6
- 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@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
id: token
with:
app-id: ${{ vars.FOREST_RELEASER_APP_ID }}
private-key: ${{ secrets.FOREST_RELEASER_APP_PRIVATE_KEY }}
- uses: peter-evans/create-pull-request@98357b18bf14b5342f975ff684046ec3b2a07725 # v8.0.0
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 }}
```