Skip to content

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

Update amp-embedded-infra-lib Git Tag

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

---
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@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@0d564482f06ca65fa9e77e2510873638c82206f2 # v1.11.5
id: token
with:
app-id: ${{ vars.FOREST_RELEASER_APP_ID }}
private-key: ${{ secrets.FOREST_RELEASER_APP_PRIVATE_KEY }}
- uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f # v7.0.6
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 }}
```