-
Notifications
You must be signed in to change notification settings - Fork 7
33 lines (31 loc) · 1.25 KB
/
unit_inventory.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
name: Unit inventory
on:
pull_request_target:
branches:
- main
jobs:
unit_inventory:
runs-on: ubuntu-24.04
steps:
# Check out the PR head on pull_request, otherwise default
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
ref: ${{ github.event.pull_request.head.ref }}
token: ${{ secrets.GH_TOKEN }}
- name: "Set up environment"
uses: packetcoders/action-setup-cache-python-poetry@0d0be5577b30d85f3fa2d93a4beeda149520f120 # v1.2.0
with:
python-version: "3.10"
poetry-version: "1.8.2"
install-args: --all-extras
- name: Install root
run: poetry run pip install -e . --no-deps
- run: poetry run ./scripts/generate_unit_inventory.py -d ampel-hu-astro --target-file README.md
- name: Commit changes
# secret action bot user id from https://github.com/actions/checkout/pull/1184
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add README.md
git commit --author="$(git log ${{ github.event.pull_request.head.ref }} -1 --pretty='%an <%ae>')" -m "chore: Update README for ${{ github.sha }}" || exit 0
git push