Skip to content

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

Update amp-embedded-infra-lib Git Tag

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

---
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 }}
```